mirror of
https://github.com/ISEAL-Community/iseal-core.git
synced 2024-11-18 04:47:04 +01:00
Alan Orth
7ed52b703a
Otherwise, in JSON, it gets interpreted as an integer (3.1). See: https://github.com/actions/setup-python/issues/160
61 lines
1.9 KiB
YAML
61 lines
1.9 KiB
YAML
name: Pages
|
|
|
|
on:
|
|
push:
|
|
|
|
jobs:
|
|
parse:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
# 2022-01-06 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.
|
|
python-version: '3.10'
|
|
- name: Install Poetry
|
|
uses: abatilo/actions-poetry@v2.1.4
|
|
- name: Install Python dependencies
|
|
run: poetry install
|
|
- name: Generate Hugo content
|
|
run: |
|
|
poetry run ./util/generate-hugo-content.py -i ./data/iseal-core.csv --clean -d
|
|
poetry run ./util/generate-hugo-content.py -i ./data/fsc.csv -d
|
|
- name: Setup Hugo
|
|
uses: peaceiris/actions-hugo@v2
|
|
- name: Build Hugo site
|
|
run: hugo
|
|
working-directory: site
|
|
- name: Commit Hugo content
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
# Only run if we are on the main branch. We don't want to create extra
|
|
# commits on feature branches or pull requests.
|
|
if: ${{ github.ref_name == 'main' }}
|
|
with:
|
|
commit_message: Automated commit with site updates
|
|
# Only commit if there are changes to the site.
|
|
file_pattern: site/*
|
|
|
|
pages:
|
|
runs-on: ubuntu-latest
|
|
# Only run if we are on the main branch. We don't want to update the site
|
|
# with content from other branches.
|
|
if: ${{ github.ref_name == 'main' }}
|
|
# We need the parse job above. Do not run if that one fails.
|
|
needs: parse
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Git pull
|
|
run: git pull
|
|
|
|
- name: Deploy
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./site/docs
|
|
publish_branch: site
|