From 882106a078df05dc626e58c62f82bbb89eccd826 Mon Sep 17 00:00:00 2001 From: Wojciech Pietraszewski Date: Wed, 7 Aug 2024 15:22:54 +0200 Subject: [PATCH 1/2] cd: Update `Deploy Site` workflow Adds a step checking if the site content has changed to avoid unnecessary GH Action execution. --- .github/workflows/deploy-site.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml index 13402789cc..7569323baa 100644 --- a/.github/workflows/deploy-site.yml +++ b/.github/workflows/deploy-site.yml @@ -33,6 +33,19 @@ jobs: with: ref: master + - name: Check For Content Changes + run: | + latest_commit=$(git rev-parse HEAD) + previous_commit=$(git rev-parse HEAD~1) + content_changed=$(git diff --name-only $previous_commit $latest_commit | grep -E '\.(html|css|js|py|md|rst)$') + + if [ -z "$content_changed" ]; then + echo "No relevant changes detected." + exit 0 + else + echo "Relevant changes detected." + fi + - name: Install Dependencies run: | sudo apt-get update From 65d5b7893985d2f68abe2353e8553305deccc053 Mon Sep 17 00:00:00 2001 From: Wojciech Pietraszewski Date: Wed, 7 Aug 2024 15:25:37 +0200 Subject: [PATCH 2/2] test gha --- .github/workflows/deploy-site.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml index 7569323baa..c914e6532b 100644 --- a/.github/workflows/deploy-site.yml +++ b/.github/workflows/deploy-site.yml @@ -18,16 +18,13 @@ # name: Deploy Site -on: - push: - branches: - - 'master' +on: push jobs: deploy: name: Deploy Site runs-on: ubuntu-20.04 - if: github.event.repository.fork == false +# if: github.event.repository.fork == false steps: - uses: actions/checkout@v3 with: