Skip to content

Commit

Permalink
Add deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kberzinch committed Mar 10, 2024
1 parent b262d9c commit 1695a4c
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/deploy-single-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy

on:
workflow_call:
inputs:
environment:
required: true
type: string
workflow_dispatch:
inputs:
environment:
required: true
type: environment

jobs:
deploy:
name: ${{ inputs.environment }}
environment:
name: ${{ inputs.environment }}
url: ${{ inputs.environment == 'test' && 'https://keycloak-test.robojackets.org' || 'https://keycloak.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 "keycloak" {/c\job "keycloak-${{ inputs.environment }}" {' keycloak.nomad
- name: Exchange GitHub JWT for Nomad token
uses: mikenomitch/[email protected]
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
run: |
nomad run keycloak.nomad

0 comments on commit 1695a4c

Please sign in to comment.