Publish #3863
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: Publish | |
on: | |
push: | |
branches-ignore: | |
- "dependabot/**" | |
- "gh-pages" | |
- "update/**" | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 22 * * *' | |
jobs: | |
build-deploy: | |
name: Build and Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
- name: Install Nox | |
run: python -m pip install nox | |
- name: Get cache timestamp | |
id: timestamp | |
run: echo "timestamp=$(nox -s timestamp 2>/dev/null)" >> $GITHUB_OUTPUT | |
- name: Setup cache | |
uses: actions/cache@v4 | |
with: | |
path: cache/* | |
key: pypi-cache-${{ steps.timestamp.outputs.timestamp }} | |
restore-keys: pypi-cache- | |
- name: Build static site | |
env: | |
BIGQUERY_TOKEN: ${{ secrets.BIGQUERY_TOKEN }} | |
run: nox -s run -- -v | |
- name: Auto-commit packages.json | |
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "[bot] Update packages.json / consumer_data on ${{ steps.timestamp.outputs.timestamp }}" | |
file_pattern: packages.json consumer_data/**/*.csv | |
- name: Deploy to GitHub Pages | |
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
folder: build | |
commit-message: "[bot] Deploying from ${{ github.sha }} on ${{ steps.timestamp.outputs.timestamp }}" | |
single-commit: true # wipe history |