chore: initial commit #1
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: Production | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
env: | |
PACT_BROKER_BASE_URL: ${{ secrets.PACT_BROKER_BASE_URL }} | |
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }} | |
PACTICIPANT: 'backend' | |
OAS_PATH=: 'oas/swagger.yml' | |
REPORT_FILE_CONTENT_TYPE: 'text/plain' | |
VERIFIER_TOOL: 'tap' | |
REPORT_PATH: 'oas/swagger.yml' | |
VERSION: ${{ github.sha }} | |
GIT_BRANCH: ${{ github.ref_name }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: yarn install | |
- name: Run tests | |
run: make test | |
- name: Publish contracts | |
run: make publish_provider_contract | |
can_i_deploy: | |
runs-on: ubuntu-latest | |
needs: test | |
env: | |
PACT_BROKER_BASE_URL: ${{ secrets.PACT_BROKER_BASE_URL }} | |
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }} | |
PACTICIPANT: 'backend' | |
VERSION: ${{ github.sha }} | |
GIT_BRANCH: ${{ github.ref_name }} | |
DEPLOYMENT_TARGET: 'production' | |
REPORT_PATH: 'oas/swagger.yml' | |
REPORT_FILE_CONTENT_TYPE: 'text/plain' | |
VERIFIER_TOOL: 'tap' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Can I deploy? | |
run: make can_i_deploy | |
deployment: | |
runs-on: ubuntu-latest | |
needs: can_i_deploy | |
env: | |
PACT_BROKER_BASE_URL: ${{ secrets.PACT_BROKER_BASE_URL }} | |
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }} | |
PACTICIPANT: 'backend' | |
VERSION: ${{ github.sha }} | |
GIT_BRANCH: ${{ github.ref_name }} | |
DEPLOYMENT_TARGET: 'production' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Deploy | |
run: make deploy | |
- name: Record deployment | |
run: make record_deployment |