Update build for gh-pages v3 options #786
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: lighthouse ci | |
on: [push] | |
# versions should be kept in sync with gh-pages workflow | |
env: | |
HUGO_VERSION: 0.119.0 # if you update this, change the README badge and gh-pages.yml too! | |
NODE_VERSION: 18 # if you update this, change the README badge and gh-pages.yml too! | |
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} | |
jobs: | |
build-ci: | |
name: build site and run lighthouse ci | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v4 | |
- name: setup hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: ${{ env.HUGO_VERSION }} | |
extended: true | |
- name: setup node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: fetch js dependencies from cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: npm-${{ hashFiles('package-lock.json') }} | |
restore-keys: | | |
npm-${{ hashFiles('package-lock.json') }} | |
npm- | |
- name: install js dependencies | |
run: npm ci | |
- name: build site | |
run: hugo --minify | |
# this step makes the site's built html and css available for download | |
# from github; see the run in github actions to access it as a zipfile. | |
# we don't export image derivatives because it makes the build a lot | |
# slower. | |
- name: export built files for download | |
uses: actions/upload-artifact@v3 | |
with: | |
name: public | |
path: | | |
public/ | |
!public/issues/**/images/ | |
# lighthouse is configured using the lighthouserc.js file in the project | |
# root, see that file for more details. output from runs is uploaded to | |
# free google cloud storage and accessible via the github action run | |
- name: audit site using lighthouse ci | |
uses: treosh/lighthouse-ci-action@v10 | |
with: | |
configPath: './lighthouserc.js' | |
uploadArtifacts: true | |
temporaryPublicStorage: true |