Skip to content

Commit

Permalink
Modify GH workflow to trigger staging redeploy after building (#1160)
Browse files Browse the repository at this point in the history
  • Loading branch information
jake-low authored Jan 7, 2025
1 parent e04fc8b commit 19d1bfd
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Build Docker Image, Push to GHCR
name: Build Docker image, push to GHCR, and trigger redeploy

on:
push:
# Publish HEAD of main branch as :latest image tag
# Run whenever main branch changes
branches: [ "main" ]
# Publish semver tags as named image tags
# ...or whenever a new semver release tag is published
tags: [ 'v*.*.*' ]

env:
Expand Down Expand Up @@ -58,3 +58,16 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

trigger-redeploy:
needs: build
runs-on: ubuntu-latest

steps:
- name: Send trigger-workflow webhook to maproulette-deploy repository
run: |
curl -X POST https://api.github.com/repos/maproulette/maproulette-deploy/dispatches \
--fail --silent --show-error --location \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.DEPLOY_REPO_TOKEN }}" \
-d '{ "event_type": "deploy maproulette-backend@${{ github.ref_name }} (${{ github.sha }})" }'

0 comments on commit 19d1bfd

Please sign in to comment.