From 15cc932ebbf2b745bf10aec8a41853d22574e021 Mon Sep 17 00:00:00 2001 From: moonstar-x Date: Sun, 3 Nov 2024 17:09:55 -0500 Subject: [PATCH] Added deploy to CI. --- .github/workflows/callable-deploy.yml | 28 +++++++++++++++++++++++++++ .github/workflows/on-push-main.yml | 11 +++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/callable-deploy.yml diff --git a/.github/workflows/callable-deploy.yml b/.github/workflows/callable-deploy.yml new file mode 100644 index 0000000..2cd883a --- /dev/null +++ b/.github/workflows/callable-deploy.yml @@ -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 }}"}' diff --git a/.github/workflows/on-push-main.yml b/.github/workflows/on-push-main.yml index 0e630d9..b63b5b8 100644 --- a/.github/workflows/on-push-main.yml +++ b/.github/workflows/on-push-main.yml @@ -15,3 +15,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 }}