chore: revert to paulogoncalves url #71
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: Consumer pipeline | |
on: | |
push: | |
paths-ignore: | |
- "provider-clients-service/**" | |
workflow_dispatch: | |
env: | |
PACT_BROKER_BASE_URL: https://paulogoncalves.pactflow.io | |
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }} | |
jobs: | |
test-contract-consumer: | |
runs-on: ubuntu-22.04 | |
name: Run consumer contract test | |
steps: | |
- name: Project checkout | |
uses: actions/checkout@v2 | |
- run: docker-compose build consumer-test-contract | |
- name: Run consumer contract test | |
run: make consumer-test-contract | |
- run: docker pull pactfoundation/pact-cli:0.50.0.14 | |
- name: Publish contract test result | |
run: | | |
docker run --rm \ | |
-w ${PWD} \ | |
-v ${PWD}:${PWD} \ | |
-e PACT_BROKER_BASE_URL \ | |
-e PACT_BROKER_TOKEN \ | |
-e GITHUB_REF \ | |
-e GITHUB_HEAD_REF \ | |
pactfoundation/pact-cli:0.50.0.14 \ | |
publish \ | |
${PWD}/consumer-frontend/pacts \ | |
--consumer-app-version ${{ github.sha }} \ | |
--auto-detect-version-properties | |
# 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-consumer | |
name: Can deploy consumer 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 frontend \ | |
--version ${{ github.sha }} \ | |
--retry-while-unknown 30 \ | |
--retry-interval 10 \ | |
--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 consumer 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-consumer-application-version-with-production: | |
needs: deploy | |
runs-on: ubuntu-22.04 | |
name: Associate consumer application version with 'production' | |
steps: | |
- uses: actions/checkout@v2 | |
- run: docker pull pactfoundation/pact-cli:0.50.0.14 | |
- name: Associate consumer 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 frontend \ | |
--version ${{ github.sha }} \ | |
--environment production |