-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (44 loc) · 1.17 KB
/
pr.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
name: PR
on:
pull_request:
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 }}
PACT_CONSUMER: 'frontend'
PACT_PROVIDER: 'backend'
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
env:
PACT_CONSUMER: 'frontend'
PACT_PROVIDER: 'backend'
- name: Publish Pact
run: make publish_pacts
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 }}
DEPLOYMENT_TARGET: 'production'
PACTICIPANT: 'frontend'
VERSION: ${{ github.sha }}
GIT_BRANCH: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v3
- name: Can I deploy?
run: make can_i_deploy