Skip to content

Update data.json and build website #803

Update data.json and build website

Update data.json and build website #803

Workflow file for this run

name: Update data.json and build website
on:
schedule:
- cron: '0 11 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Setup Git Profile
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Update data.json
run: python3 update_data_json.py
- name: Add and commit files
run: |
git add data.json
set +e
git diff --cached --quiet
echo "modified=$?" >> $GITHUB_OUTPUT
set -e
id: status_add
- name: Commit files
if: steps.status_add.outputs.modified == '1'
run: |
git commit -m "Update data.json"
- name: Push changes
if: steps.status_add.outputs.modified == '1'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
- name: Build website
run: |
npm ci
npm run build
- name: Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
branch: gh-pages