Update gh-pages.yml #964
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 GitHub pages | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '30 3 * * */1' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
runs-on: ubuntu-22.04 | |
steps: | |
# - name: Maximize build space | |
# uses: easimon/maximize-build-space@master | |
# with: | |
# root-reserve-mb: 4096 | |
# temp-reserve-mb: 1096 | |
# remove-android: 'true' | |
# remove-haskell: 'true' | |
# remove-codeql: 'true' | |
# remove-dotnet: 'true' | |
- name: Free some disk space | |
run: | | |
sudo rm -rf /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL | |
- name: Login to GitHub Packages Docker Registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
logout: false | |
- uses: actions/checkout@v4 | |
with: | |
submodules: false # Fetch Hugo themes (true OR recursive) | |
- name: Checkout submodules | |
run: | | |
git submodule update --init --depth 1 -j 4 themes/* | |
for dir in `ls blogs/`; do echo "Checking out submodule blogs/$dir" ; git submodule update --depth 1 -j 4 --init blogs/$dir ; rm -rf blogs/$dir/.git ; find blogs/$dir -type f -size +1M -name '*.jpg' -print -exec rm {} \; ; done | |
# ./scripts/git-checkout.sh | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install required dependencies | |
run: | | |
./scripts/github-setup.sh | |
- name: Setup Node.js | |
uses: actions/[email protected] | |
with: | |
node-version-file: '.nvmrc' | |
- name: Generate Files | |
env: | |
SKIP_IIIF: yes | |
run: | | |
./scripts/setup.sh | |
- name: Create IIIF derivates | |
run: | | |
docker run -v ${PWD}:${PWD} ghcr.io/cmahnke/iiif-action:latest-jxl-uploader sh -c "cd ${PWD} && ./scripts/iiif.sh" | |
- name: Setup Hugo | |
uses: peaceiris/[email protected] | |
with: | |
hugo-version: '0.118.2' | |
extended: true | |
- name: Build Hugo site | |
run: hugo --printI18nWarnings --printUnusedTemplates | |
- name: Index and cleanup | |
run: | | |
./scripts/post-build.sh | |
- name: Puppeteer | |
run: ./themes/projektemacher-base/scripts/github/check-js-errors.sh | |
- name: Deploy site | |
uses: peaceiris/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs | |
force_orphan: true |