From e81ea897b7b01d63f75c104c5506f42c24c13fb3 Mon Sep 17 00:00:00 2001 From: David Linke Date: Sat, 12 Oct 2024 12:02:31 +0200 Subject: [PATCH] Add Sphinx site build to gh-actions & dependabot Changes all gh-actions files to use hash-based identifiers for the used external actions. Change from Python 3.11 to 3.12 --- .github/dependabot.yml | 6 ++++++ .github/workflows/ci-pr.yml | 8 ++++---- .github/workflows/merge.yml | 20 ++++++++++++++------ .github/workflows/publish.yml | 22 +++++++++++++++------- 4 files changed, 39 insertions(+), 17 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..7a968a8 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: monthly diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 543366e..f5d70e4 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -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. @@ -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 @@ -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: | diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index f58cf28..8401bbe 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -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: | @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4d1bb28..529c754 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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: | @@ -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 @@ -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 @@ -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