diff --git a/.github/workflows/deploy-to-staging.yml b/.github/workflows/deploy-to-staging.yml index f0b39713c3..551b299d3a 100644 --- a/.github/workflows/deploy-to-staging.yml +++ b/.github/workflows/deploy-to-staging.yml @@ -43,6 +43,27 @@ jobs: - name: Build data run: | python scripts/build_data.py + - name: Check if there are any changes to files + id: verify_diff + run: | + if [[ `git status -s` ]]; then + echo "DIFF=true" >> "$GITHUB_OUTPUT" + else + echo "DIFF=false" >> "$GITHUB_OUTPUT" + fi + - name: Commit files + if: steps.verify_diff.outputs.DIFF == 'true' + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add . + git commit -m "Add new progress measure updates" + - name: Push changes + if: steps.verify_diff.outputs.DIFF == 'true' + uses: ad-m/github-push-action@master + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: ${{ github.ref }} - name: Place public files run: | cp public/robots-staging.txt _site/robots.txt