Skip to content

Commit

Permalink
Add Sphinx site build to gh-actions & dependabot
Browse files Browse the repository at this point in the history
Changes all gh-actions files to use hash-based
identifiers for the used external actions.
Change from Python 3.11 to 3.12
  • Loading branch information
dalito committed Oct 12, 2024
1 parent 60274d6 commit e81ea89
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 17 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
8 changes: 4 additions & 4 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

steps:
- name: Checkout PR branch into cwd
uses: actions/checkout@v4
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
with:
# Checkout the fork/head-repository to push changes to the fork.
# Without this the base repository will be checked out and committed to.
Expand All @@ -40,7 +40,7 @@ jobs:
ref: ${{ github.head_ref }}

- name: Checkout main branch into directory _main_branch/
uses: actions/checkout@v4
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
with:
ref: main
path: _main_branch
Expand All @@ -49,9 +49,9 @@ jobs:
vocabularies/
fetch-depth: 1

- uses: actions/setup-python@v5
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
with:
python-version: '3.11'
python-version: '3.12'

- name: Install dependencies
run: |
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
with:
# Using fetch-depth 0 is the only way to get all tags which are needed for building docs.
fetch-depth: 0

- name: Checkout gh-pages branch to dir publish/
uses: actions/checkout@v4
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
with:
ref: gh-pages
path: publish
fetch-depth: 1

- uses: actions/setup-python@v5
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
with:
python-version: '3.11'
python-version: '3.12'

- name: Install dependencies
run: |
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
# Build joined turtle
voc4cat transform --logfile publish/dev/voc4cat.log --join publish/dev/
- name: Run voc4cat (build HTML documentation)
- name: Run voc4cat (build pyLODE HTML documentation)
run: |
voc4cat docs --force --logfile publish/dev/voc4cat.log publish/dev/
# move versions-overview to what becomes gh-pages root
Expand All @@ -89,6 +89,13 @@ jobs:
run: |
voc4cat convert --logfile publish/dev/voc4cat.log --outputformat xml publish/dev/voc4cat.xlsx
- name: Build Sphinx documentation (website)
run: |
python -VV
python -m pip install -r docs/requirements.txt --force
sphinx-build --nitpicky --fail-on-warning --keep-going docs docs/_build
cp -r docs/_build/. publish/
- name: Deploy updated gh-pages content
# This replaces all prior content in gh-pages branch. But we have
# checked out the gh-pages branch above so that we keep all prior
Expand All @@ -106,10 +113,11 @@ jobs:
# This step is not required and may be removed.
# It may be helpful for trouble shooting.
if: ${{ always() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
with:
name: voc4cat-pages-dev-content
path: publish/
retention-days: 5

# Lit:
# https://github.com/peaceiris/actions-gh-pages
22 changes: 15 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
with:
# Using fetch-depth 0 is the only way to get all tags which are needed for building docs.
fetch-depth: 0

- name: Checkout gh-pages branch to dir publish/
uses: actions/checkout@v4
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
with:
ref: gh-pages
path: publish
fetch-depth: 1

- uses: actions/setup-python@v5
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
with:
python-version: '3.11'
python-version: '3.12'

- name: Install dependencies
run: |
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
# Build joined turtle
voc4cat transform --logfile publish/latest/voc4cat.log --join publish/latest/
- name: Run voc4cat (build HTML documentation)
- name: Run voc4cat (build pyLODE HTML documentation)
run: |
voc4cat docs --force --logfile publish/latest/voc4cat.log publish/latest/
# move versions-overview to what becomes gh-pages root
Expand All @@ -92,6 +92,13 @@ jobs:
mkdir -p publish/${{ github.ref_name }}
cp -r publish/latest/. publish/${{ github.ref_name }}/
- name: Build Sphinx documentation (website)
run: |
python -VV
python -m pip install -r docs/requirements.txt --force
sphinx-build --nitpicky --fail-on-warning --keep-going docs docs/_build
cp -r docs/_build/. publish/
- name: Deploy updated gh-pages content
# This replaces all prior content in gh-pages branch. But we have
# checked out the gh-pages branch above so that we keep all prior
Expand All @@ -106,12 +113,13 @@ jobs:

- name: Store publish dir (=pages) as artifact
# This step is not required and may be removed.
# It may be helpful for trouble shooting.
# It may be helpful for troubleshooting.
if: ${{ always() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
with:
name: voc4cat-pages-release-${{ github.ref_name }}
path: publish/
retention-days: 5

# Lit:
# https://github.com/peaceiris/actions-gh-pages

0 comments on commit e81ea89

Please sign in to comment.