Skip to content

Commit

Permalink
Add: reusing workflow to call the reload trigger for a Nomad service (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueBrain committed Jun 13, 2023
1 parent 3539d40 commit 3e34b3e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/rw-nomad-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
required: true

concurrency:
group: nomad-deploy
group: nomad-deploy-${{ inputs.service }}

jobs:
deploy:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/rw-nomad-reload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Nomad Reload

# Triggers the reload triggers of a service on Nomad.

on:
workflow_call:
inputs:
service:
description: Name of the service to reload
required: true
type: string
secrets:
NOMAD_SERVICE_KEY:
description: Secret key to reload services
required: true
RELOAD_SECRET:
description: Reload secret to reload service
required: true

concurrency:
group: nomad-reload-${{ inputs.service }}

jobs:
reload:
runs-on: ubuntu-latest
name: Reload

steps:
- name: Reload
run: |
curl --fail -L -s -N -X POST \
-H "Content-Type: application/json" \
-d '{"secret":"${{ secrets.RELOAD_SECRET }}"}' \
https://nomad-service.openttd.org/reload/${{ inputs.service }}/${{ secrets.NOMAD_SERVICE_KEY }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ job:
- [Entry - Release - Docker/Nomad](.github/workflows/rw-entry-release-docker-nomad.yml): Entrypoint for releasing projects using Docker and Nomad
- [Entry - Testing - Docker/Python](.github/workflows/rw-entry-testing-docker-py.yml): Entrypoint for testing projects using Docker and Python
- [Nomad - Deploy](.github/workflows/rw-nomad-deploy.yml): Deploy a new service no Nomad.
- [Nomad - Reload](.github/workflows/rw-nomad-reload.yml): Triggers the reload triggers of a service on Nomad.
- [Preview - Label](.github/workflows/rw-preview-label.yml): Ensure this PR is the only one with a preview label.
- [Python - Black](.github/workflows/rw-py-black.yml): Runs "black" over the code.
- [Python - CodeQL](.github/workflows/rw-py-codeql.yml): Runs "CodeQL" over the code.
Expand Down

0 comments on commit 3e34b3e

Please sign in to comment.