Skip to content

Commit

Permalink
Deploy deployer changes automatically
Browse files Browse the repository at this point in the history
This makes sure changes to services.json is deployed.
  • Loading branch information
henrist committed Mar 29, 2024
1 parent c41901b commit a8b04af
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ansible-deployer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy deployer
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "ansible/roles/service-deployer/**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Deploy secondary from primary
if: github.ref == 'refs/heads/main'
run: |
curl --fail -L -i -H "authorization: bearer $DEPLOYER_TOKEN" -H "content-type: application/json" -X POST https://deployer.foreningenbs.no/deploy -d '
{
"service": "deployer-secondary"
}'
env:
DEPLOYER_TOKEN: ${{ secrets.DEPLOYER_TOKEN }}

- name: Deploy primary from secondary
if: github.ref == 'refs/heads/main'
run: |
curl --fail -L -i -H "authorization: bearer $DEPLOYER_TOKEN" -H "content-type: application/json" -X POST https://deployer-secondary.foreningenbs.no/deploy -d '
{
"service": "deployer-primary"
}'
env:
DEPLOYER_TOKEN: ${{ secrets.DEPLOYER_TOKEN }}

0 comments on commit a8b04af

Please sign in to comment.