chore: revert to paulogoncalves url #66
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Provider pipeline | |
on: | |
push: | |
paths-ignore: | |
- "consumer-frontend/**" | |
workflow_dispatch: | |
env: | |
PACT_BROKER_BASE_URL: https://paulogoncalves.pactflow.io | |
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }} | |
jobs: | |
test-contract-provider: | |
runs-on: ubuntu-22.04 | |
name: Run provider contract test | |
steps: | |
- name: Project checkout | |
uses: actions/checkout@v2 | |
- run: docker-compose build provider-test-contract | |
- name: Run provider contract test | |
run: make provider-test-contract | |
# Runs on branches as well, so we know the status of our PRs | |
can-i-deploy-to-production: | |
runs-on: ubuntu-22.04 | |
needs: test-contract-provider | |
name: Can deploy provider to 'production'? | |
steps: | |
- uses: actions/checkout@v2 | |
- run: docker pull pactfoundation/pact-cli:0.50.0.14 | |
- name: Can I deploy to production? | |
run: | | |
docker run --rm \ | |
-e PACT_BROKER_BASE_URL \ | |
-e PACT_BROKER_TOKEN \ | |
pactfoundation/pact-cli:0.50.0.14 \ | |
broker can-i-deploy \ | |
--pacticipant clients-service \ | |
--version ${{ github.sha }} \ | |
--to-environment production | |
# Only deploy from main | |
deploy: | |
if: github.ref == 'refs/heads/main' | |
needs: can-i-deploy-to-production | |
runs-on: ubuntu-22.04 | |
name: Deploy provider to 'production' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Deploy | |
run: | | |
echo "\n========== STAGE: deploy ==========\n" | |
echo "Deploying to production" | |
echo "\n========== Deploy finished ==========\n" | |
associate-provider-application-version-with-production: | |
needs: deploy | |
runs-on: ubuntu-22.04 | |
name: Associate provider application version with 'production' | |
steps: | |
- uses: actions/checkout@v2 | |
- run: docker pull pactfoundation/pact-cli:0.50.0.14 | |
- name: Associate provider application version with 'production' environment | |
run: | | |
docker run --rm \ | |
-e PACT_BROKER_BASE_URL \ | |
-e PACT_BROKER_TOKEN \ | |
pactfoundation/pact-cli:0.50.0.14 \ | |
broker record-deployment \ | |
--pacticipant clients-service \ | |
--version ${{ github.sha }} \ | |
--environment production |