-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (63 loc) · 1.82 KB
/
production.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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