From bb554a62fb9bd28449b6763d25259f68f194f6ab Mon Sep 17 00:00:00 2001 From: Bill Stumbo Date: Sat, 7 Sep 2024 19:18:28 -0400 Subject: [PATCH] Updates to move out some of the peaceiris actions --- .github/workflows/gh-pages.yml | 55 ++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 9dcc1bd2c..5aaedf332 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -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: # ---------------------------------------------------------------------------- @@ -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 }} @@ -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 @@ -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 @@ -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