diff --git a/.gitea/deploy.yml b/.gitea/deploy.yml new file mode 100644 index 0000000..b21dfbf --- /dev/null +++ b/.gitea/deploy.yml @@ -0,0 +1,39 @@ +name: Deploy Discord Bot + +on: + push: + branches: + - main + +jobs: + deploy: + # Muss zu deinem Runner-Label passen! + # Wenn du beim act_runner z.B. "ubuntu-latest" als Label eingetragen hast: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: https://github.com/actions/checkout@v4 + + - name: Check if commit message contains 'deploy' + id: check_deploy + run: | + MSG="${{ gitea.event.head_commit.message }}" + echo "Commit message: $MSG" + if echo "$MSG" | grep -iq "deploy"; then + echo "should_deploy=true" >> $GITEA_OUTPUT + else + echo "should_deploy=false" >> $GITEA_OUTPUT + fi + + - name: Stop if no deploy keyword + if: steps.check_deploy.outputs.should_deploy != 'true' + run: | + echo "No 'deploy' keyword in commit message. Skipping deployment." + exit 0 + + - name: Run deploy script on host + if: steps.check_deploy.outputs.should_deploy == 'true' + run: | + echo "Starte deploy.sh auf dem Docker-Host..." + /opt/Papo/deploy.sh