From 51204c37543d143940b9875faec41987b4162c7b Mon Sep 17 00:00:00 2001 From: moonstar-x Date: Sun, 3 Nov 2024 17:12: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 53eb54e..28f5fc9 100644 --- a/.github/workflows/on-push-main.yml +++ b/.github/workflows/on-push-main.yml @@ -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 }}