-
-
Notifications
You must be signed in to change notification settings - Fork 262
63 lines (61 loc) · 1.99 KB
/
_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
name: Deploy on Heroku
on:
workflow_call:
inputs:
service:
description: 'The service/app to build'
type: string
required: true
app-name:
description: 'The Heroku app name to which the application should be deployed'
type: string
required: true
bypass_diff_check:
description: 'Bypass the monorepo diff check'
required: false
type: string
secrets:
HEROKU_EMAIL:
required: true
HEROKU_API_KEY:
required: true
OP_SERVICE_ACCOUNT_TOKEN:
required: true
jobs:
deploy-to-heroku:
name: Deploy ${{ inputs.service }} on Heroku (${{ inputs.app-name }})
runs-on: ubuntu-24.04
env:
DOCKER_REPOSITORY: unlockprotocol
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
steps:
- name: 'Free up disk space'
run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for changes in ${{ inputs.service }}
run: |
if [ -z "${{ inputs.bypass_diff_check }}" ]; then
changed=$(scripts/monorepo.sh ${{ inputs.service }} ${{ github.ref_name }})
else
changed="changed"
fi
echo $changed
echo "::set-output name=changed::$changed"
shell: bash
id: check_changes
- name: Load secrets from 1Password
uses: 1Password/[email protected]
with:
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
- name: Build & deploy to heroku
if: ${{ steps.check_changes.outputs.changed == 'changed' }}
run: |
sh ./scripts/heroku.sh ${{ inputs.service }} ${{ inputs.app-name }}
env:
HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }}
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}