Skip to content

Updates to move out some of the peaceiris actions #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 46 additions & 9 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,26 @@ on:
push:
branches:
- main # Set a branch to deploy

schedule:
- cron: "0 3 * * *"

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

defaults:
run:
shell: bash

env:
# ----------------------------------------------------------------------------
# Specify the deployment environment: staging or production
hugoEnvironment: production
hugoEnvironment: staging
HUGO_VERSION: 0.133.1

jobs:
# ----------------------------------------------------------------------------
Expand All @@ -42,6 +55,7 @@ jobs:
outputs:
zoteroVersion: ${{ fromJson(steps.zoteroVersion.outputs.headers).last-modified-version }}
cacheHit: ${{ steps.cache-zotero-bib.outputs.cache-hit }}

runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -74,7 +88,10 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push' || needs.check.outputs.cacheHit != 'true'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4A
with:
submodules: recursive
fetch-depth: 0

- name: Cache Zotero Bibliography
id: cache-zotero-bib
Expand Down Expand Up @@ -102,13 +119,24 @@ jobs:
./update_bibliography.sh
sudo cp --recursive ${GITHUB_WORKSPACE}/static/data ~/data
fi
shell: bash

- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.133.1'
extended: true
- name: Install Dart Sass
run: sudo snap install dart-sass

- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb

# - name: Setup Hugo
# uses: peaceiris/actions-hugo@v3
# with:
# hugo-version: ${{ HUGO_VERSION }}
# extended: true

- name: Setup Pages
id: pages
uses: actions/configure-pages@v5

- name: Setup Node
uses: actions/setup-node@v4
Expand All @@ -120,7 +148,16 @@ jobs:
- run: npm install --verbose

- name: Build
run: hugo -e staging
env:
HUGOENVIRONMENT: staging
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
TZ: America/New York
run: hugo --gc

# - name: Upload artifact
# uses: actions/upload-pages-artifact@v3
# with:
# path: ./public

- name: Deploy
uses: peaceiris/actions-gh-pages@v4
Expand Down