39 lines
1.0 KiB
YAML
39 lines
1.0 KiB
YAML
name: Deploy Discord Bot
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
# Label muss zu deinem Runner passen!
|
|
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="${{ github.event.head_commit.message }}"
|
|
echo "Commit message: $MSG"
|
|
if echo "$MSG" | grep -iq "deploy"; then
|
|
echo "should_deploy=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "should_deploy=false" >> $GITHUB_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
|