diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 02c1878..bad2b1b 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -3,7 +3,7 @@ name: Deploy Blog to Folder on: push: branches: - - main # or your target branch + - main jobs: deploy: @@ -13,15 +13,29 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Check commit message for "skipdeploy" + id: check_commit + run: | + COMMIT_MSG=$(git log -1 --pretty=%B) + echo "Last commit message: $COMMIT_MSG" + if [[ "$COMMIT_MSG" == skipdeploy* ]]; then + echo "Skipping deployment due to commit message." + echo "should_deploy=false" >> $GITHUB_ENV + else + echo "should_deploy=true" >> $GITHUB_ENV + fi + - name: Build site + if: env.should_deploy == 'true' run: | cd ./src npx @11ty/eleventy - name: Deploy folder + if: env.should_deploy == 'true' run: | echo "Cleaning old site files..." rm -rf /var/sites/cy.cyper.cc/www/html/* echo "Deploying new site files from src/_site folder..." - mv ./src/_site/* /var/sites/cy.cyper.cc/www/html \ No newline at end of file + mv ./src/_site/* /var/sites/cy.cyper.cc/www/html