-
Notifications
You must be signed in to change notification settings - Fork 5
65 lines (58 loc) · 1.91 KB
/
deploy.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
name: Deploy
on:
workflow_call:
inputs:
image-digest:
required: true
type: string
environment:
required: true
type: string
precompressed-assets:
required: true
type: boolean
workflow_dispatch:
inputs:
image-digest:
required: true
type: string
environment:
required: true
type: environment
precompressed-assets:
required: true
type: boolean
concurrency:
group: ${{ inputs.environment }}
cancel-in-progress: true
jobs:
deploy:
name: ${{ inputs.environment }}
environment:
name: ${{ inputs.environment }}
url: ${{ inputs.environment == 'test' && 'https://apiary-test.robojackets.org' || (inputs.environment == 'sandbox' && 'https://apiary-sandbox.robojackets.org' || (inputs.environment == 'production' && 'https://my.robojackets.org' || 'https://robojackets.org')) }}
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nomad
uses: lucasmelin/[email protected]
- name: Set job name
working-directory: ./.nomad/
run: |
sed -i '/job "apiary" {/c\job "apiary-${{ inputs.environment }}" {' apiary.nomad
- name: Exchange GitHub JWT for Nomad token
uses: RoboJackets/nomad-jwt-auth@main
with:
url: https://nomad.bcdc.robojackets.net
jwtGithubAudience: https://nomad.bcdc.robojackets.net
methodName: GitHub
- name: Run Nomad job
env:
NOMAD_ADDR: https://nomad.bcdc.robojackets.net
working-directory: ./.nomad/
run: |
nomad run -var image=registry.bcdc.robojackets.net/apiary@${{ inputs.image-digest }} -var precompressed_assets=${{ inputs.precompressed-assets }} -var-file var-files/${{ inputs.environment }}.hcl apiary.nomad