Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify GitHub Actions workflow to trigger staging redeploy after building #1160

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }})" }'
Loading