From d3e319fbf1e4abf6a9c9f53742e3925ab8b3e469 Mon Sep 17 00:00:00 2001 From: Yohei Yasukawa Date: Mon, 20 Nov 2023 11:43:28 +0900 Subject: [PATCH] Update actions: Stop deploying to Pages if no updates --- .github/workflows/scheduler_daily.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scheduler_daily.yml b/.github/workflows/scheduler_daily.yml index f4ee59f..7ec9d8a 100644 --- a/.github/workflows/scheduler_daily.yml +++ b/.github/workflows/scheduler_daily.yml @@ -44,7 +44,9 @@ jobs: - name: 🆙 Update profile if updated run: | + echo "IS_UPDATED=false" >> $GITHUB_ENV if [ -n "$(git status --porcelain)" ]; then + echo "IS_UPDATED=true" >> $GITHUB_ENV git config --global user.name "Yohei Yasukawa" git config --global user.email "yohei@yasslab.jp" git checkout main @@ -62,7 +64,7 @@ jobs: SKIP_BUILD=true bundle exec rake test - name: 🚀 Deploy to GitHub Pages - if: github.ref == 'refs/heads/main' && job.status == 'success' + if: github.ref == 'refs/heads/main' && job.status == 'success' && env.IS_UPDATED == 'true' uses: peaceiris/actions-gh-pages@v3 with: personal_token: ${{ secrets.GITHUB_TOKEN }}