-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (59 loc) · 1.93 KB
/
deploy.yml
File metadata and controls
66 lines (59 loc) · 1.93 KB
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
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://loop-test.robojackets.org' || (inputs.environment == 'production' && 'https://loop.robojackets.org' || 'https://robojackets.org') }}
permissions:
id-token: write
contents: read
packages: read
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Nomad
uses: lucasmelin/setup-nomad@v2.0.0
- name: Set job name
working-directory: ./.nomad/
run: |
sed -i '/job "loop" {/c\job "loop-${{ inputs.environment }}" {' loop.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: GitHubActions
- name: Run Nomad job
env:
NOMAD_ADDR: https://nomad.bcdc.robojackets.net
working-directory: ./.nomad/
run: |
nomad run -var image=ghcr.io/robojackets/loop@${{ inputs.image-digest }} -var registry_username=${{ github.actor }} -var registry_password=${{ secrets.GITHUB_TOKEN }} -var precompressed_assets=${{ inputs.precompressed-assets }} -var environment_name=${{ inputs.environment }} loop.nomad