2021-11-01 07:38:05 +01:00
|
|
|
name: Pages
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
|
|
|
|
jobs:
|
2021-12-14 13:02:16 +01:00
|
|
|
parse:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
2021-12-14 13:54:07 +01:00
|
|
|
# 2021-12-14 this is currently an OK choice, but it will need to be
|
|
|
|
# updated eventually as the ecosystem moves. Keep in sync with the
|
|
|
|
# version in pyproject.toml.
|
2021-12-14 13:02:16 +01:00
|
|
|
python-version: 3.9
|
|
|
|
- name: Install Poetry
|
|
|
|
uses: abatilo/actions-poetry@v2.1.4
|
2021-12-14 13:22:21 +01:00
|
|
|
- name: Install Python dependencies
|
|
|
|
run: poetry install
|
|
|
|
- name: Generate Hugo content
|
|
|
|
run: |
|
2021-12-20 11:04:11 +01:00
|
|
|
poetry run ./util/generate-hugo-content.py -i ./data/iseal-core.csv --clean -d
|
2021-12-21 17:37:13 +01:00
|
|
|
poetry run ./util/generate-hugo-content.py -i ./data/fsc.csv -d
|
2021-12-14 13:46:16 +01:00
|
|
|
- name: Setup Hugo
|
|
|
|
uses: peaceiris/actions-hugo@v2
|
2021-12-14 13:48:06 +01:00
|
|
|
- name: Build Hugo site
|
|
|
|
run: hugo
|
|
|
|
working-directory: site
|
2021-12-14 13:46:16 +01:00
|
|
|
- name: Commit Hugo content
|
|
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
|
|
with:
|
|
|
|
commit_message: Automated commit with site updates
|
2021-12-14 13:54:07 +01:00
|
|
|
# Only commit if there are changes to the site.
|
2021-12-14 13:48:06 +01:00
|
|
|
file_pattern: site/*
|
2021-12-14 13:58:01 +01:00
|
|
|
|
2021-11-01 07:38:05 +01:00
|
|
|
pages:
|
|
|
|
runs-on: ubuntu-latest
|
2021-12-14 13:58:01 +01:00
|
|
|
# Only run if we are on the main branch. We don't want to update the site
|
|
|
|
# with content from other branches.
|
2021-12-14 13:09:58 +01:00
|
|
|
if: ${{ github.ref_name == 'main' }}
|
2021-12-14 13:54:54 +01:00
|
|
|
# We need the parse job above. Do not run if that one fails.
|
|
|
|
needs: parse
|
2021-11-01 07:38:05 +01:00
|
|
|
steps:
|
2021-12-14 14:14:37 +01:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Git pull
|
|
|
|
run: git pull
|
|
|
|
|
2021-11-01 07:38:05 +01:00
|
|
|
- name: Deploy
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish_dir: ./site/docs
|
2021-11-01 07:41:17 +01:00
|
|
|
publish_branch: site
|