From 92ab6ceda8c30047a8019d8c743024d332b3309c Mon Sep 17 00:00:00 2001 From: Refringe Date: Thu, 28 Mar 2024 14:52:56 +0000 Subject: [PATCH] Server Build Trigger (!273) This is a workflow that triggers the build workflow of the Build project whenever this project has a tag pushed to it. Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/273 --- .gitea/workflows/build-trigger.yaml | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .gitea/workflows/build-trigger.yaml diff --git a/.gitea/workflows/build-trigger.yaml b/.gitea/workflows/build-trigger.yaml new file mode 100644 index 00000000..9bfbee4f --- /dev/null +++ b/.gitea/workflows/build-trigger.yaml @@ -0,0 +1,35 @@ +name: Trigger Main Build Pipeline + +on: + push: + tags: + - '*' + +jobs: + trigger-main-build: + runs-on: ubuntu-latest + steps: + - name: Setup Git Config + run: | + git config --global user.email "triggerbot@example.com" + git config --global user.name "TriggerBot" + + - name: Clone Build Repository + run: | + rm -rf ../Build + git clone https://${{ secrets.BUILD_USERNAME }}:${{ secrets.BUILD_ACCESS_TOKEN }}@dev.sp-tarkov.com/SPT-AKI/Build.git ../Build + + - name: Trigger Branch + working-directory: ../Build + run: git checkout -b trigger || git checkout trigger + + - name: Create Trigger File + working-directory: ../Build + run: | + echo "${GITHUB_REF_NAME}" > .gitea/trigger + git add .gitea/trigger + git commit -m "Server triggered build with tag '${GITHUB_REF_NAME}'" + + - name: Force Push + working-directory: ../Build + run: git push --force origin trigger