Skip to content

Commit

Permalink
feat: add deployment workflow for main branch
Browse files Browse the repository at this point in the history
Add a new deployment job to the build workflow that triggers 
only on the main branch. Create a separate deploy workflow 
that updates the deployment using a repository dispatch event. 
This change streamlines the deployment process and ensures 
that deployments occur only from the main branch.
  • Loading branch information
H1ghBre4k3r committed Nov 2, 2024
1 parent 11a9d94 commit 549b456
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ jobs:
needs: build
uses: ./.github/workflows/image.yml
secrets: inherit

deploy:
if: ${{ github.ref_name == 'main' }}
needs: image
uses: ./.github/workflows/deploy.yml
secrets: inherit
18 changes: 18 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Deploy

on:
workflow_call:

jobs:
update-deployment:
name: Update Deployment
runs-on: self-hosted

steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GH_PAT }}
repository: pesca-dev/kneipolympics-deploy
event-type: kneipolympics-deploy-trigger
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'

0 comments on commit 549b456

Please sign in to comment.