Skip to content

Commit

Permalink
Added deploy to CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
moonstar-x committed Nov 3, 2024
1 parent 4e18d91 commit 51204c3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/callable-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Trigger Deployment

on:
workflow_call:
inputs:
repo:
type: string
required: true
message:
type: string
required: true
secrets:
token:
required: true

jobs:
deploy:
name: Trigger Deployment
runs-on: ubuntu-latest

steps:
- name: Dispatch Deployment
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.token }}
repository: ${{ inputs.repo }}
event-type: deploy
client-payload: '{"message": "${{ inputs.message }}"}'
11 changes: 11 additions & 0 deletions .github/workflows/on-push-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,14 @@ jobs:
image_tag: latest
secrets:
ghcr_token: ${{ secrets.GITHUB_TOKEN }}

deploy:
name: Trigger Deployment
uses: ./.github/workflows/callable-deploy.yml
needs:
- build
with:
repo: ${{ vars.DEPLOYMENT_REPO }}
message: Deployed from ${{ github.repository }} by ${{ github.actor }}
secrets:
token: ${{ secrets.REPO_DISPATCH_TOKEN }}

0 comments on commit 51204c3

Please sign in to comment.