Collect status JSON #1151
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Collect status JSON | |
on: | |
schedule: | |
# Merge happens twice a day, and either of them runs the js(esm) job. | |
# Run this twice a day as well, to catch both of them. | |
- cron: '0 0,12 * * *' | |
push: | |
branch: gh-pages | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: gh-pages | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: "3.7" | |
- name: Setup Git Profile | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
- name: Collect status JSON | |
run: python3 collect_status.py | |
- name: Add files | |
run: | | |
git add . | |
set +e | |
git diff --cached --quiet | |
echo "##[set-output name=modified;]$?" | |
set -e | |
id: status_add | |
- name: Commit files | |
if: steps.status_add.outputs.modified == '1' | |
run: | | |
git commit -m "Update status JSON" -a | |
- name: Push changes | |
if: steps.status_add.outputs.modified == '1' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages |