-
Notifications
You must be signed in to change notification settings - Fork 9
87 lines (78 loc) · 2.18 KB
/
deploy-to-heroku.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Deploy to Heroku and test
on:
workflow_call:
inputs:
app:
required: false
type: string
node:
required: false
type: string
default: 22
secrets:
CYPRESS_PROJECT_ID:
required: false
CYPRESS_RECORD_KEY:
required: false
HEROKU_API_KEY:
required: true
HEROKU_APP_NAME:
required: true
HEROKU_EMAIL:
required: true
jobs:
build-and-deploy:
name: Build and deploy application
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
with:
node: ${{ inputs.node }}
- name: Build
uses: ./.github/actions/build-app
with:
app: ${{ inputs.app }}
- name: Deploy
uses: ./.github/actions/deploy-to-heroku
with:
app: ${{ inputs.app }}
heroku-api-key: ${{ secrets.HEROKU_API_KEY }}
heroku-app-name: ${{ secrets.HEROKU_APP_NAME }}
heroku-email: ${{ secrets.HEROKU_EMAIL }}
test:
name: Test
needs:
- build-and-deploy
runs-on: ubuntu-latest
strategy:
matrix:
browser: [ 'electron' ]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
with:
node: ${{ inputs.node }}
- name: Run functional tests
uses: './.github/actions/test-app'
with:
app: ${{ inputs.app }}
base-url: https://${{ secrets.HEROKU_APP_NAME }}.herokuapp.com
browser: ${{ matrix.browser }}
cypress-project-id: ${{ secrets.CYPRESS_PROJECT_ID }}
cypress-record-key: ${{ secrets.CYPRESS_RECORD_KEY }}
deployment: heroku
node: 22
smoke: true
- name: Scan service for vulnerabilities
uses: './.github/actions/scan-app'
with:
app: ${{ inputs.app }}
baseline-branch: ${{ inputs.production-branch }}
smoke: true
target: https://${{ secrets.HEROKU_APP_NAME }}.herokuapp.com
token: ${{ secrets.GITHUB_TOKEN }}