From 8ffd4bf13037ffbd56e5dc3d712149b4e0bf8e11 Mon Sep 17 00:00:00 2001 From: Cyper Date: Fri, 20 Jun 2025 16:47:23 -0400 Subject: [PATCH] nodeply: Corrected logic for skipping deployment --- .gitea/workflows/deploy.yaml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 99f8435..54d0ffe 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -10,25 +10,21 @@ jobs: runs-on: host steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Print available event data + - name: Skip deployment if commit starts with "nodeploy" + id: skip_check run: | - echo "${{ toJson(gitea) }}" - - - name: Check commit message for "nodeploy" - id: check_commit - run: | - COMMIT_MSG=$(git log -1 --pretty=%B) - echo "Last commit message: $COMMIT_MSG" + COMMIT_MSG="${{ event.head_commit.message }}" + echo "Commit message: $COMMIT_MSG" if [[ "$COMMIT_MSG" == nodeploy* ]]; then - echo "Skipping deployment due to commit message." echo "should_deploy=false" >> $GITHUB_ENV else echo "should_deploy=true" >> $GITHUB_ENV fi + - name: Checkout code + if: env.should_deploy == 'true' + uses: actions/checkout@v3 + - name: Build site if: env.should_deploy == 'true' run: | @@ -40,6 +36,6 @@ jobs: 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