Add 2023-2024 MIT license #2
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: Deploy site to GitHub Pages | |
# Adapted from https://gohugo.io/hosting-and-deployment/hosting-on-github/ | |
# Run when pushed to 'main' or dispatched manually: | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
# Grant permissions to deploy to GitHub pages: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Limit to one deployment at a time and always finish pending jobs: | |
concurrency: | |
group: pages | |
cancel-in-progress: false | |
# Run commands using Bash: | |
defaults: | |
run: | |
shell: bash | |
# Generate, upload, and deploy site: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
HUGO_VERSION: 0.121.1 | |
steps: | |
- name: Install Hugo | |
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 | |
## Uncomment if using Dart Sass: | |
#- name: Install Dart Sass | |
# run: sudo snap install dart-sass | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
## Uncomment if using Git submodules: | |
#with: | |
# submodules: recursive | |
# fetch-depth: 0 | |
- name: Configure GitHub Pages | |
id: pages | |
uses: actions/configure-pages@v4 | |
## Uncomment if using Node.js packages: | |
#- name: Install Node.js packages | |
# run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" | |
- name: Generate site with Hugo | |
env: | |
HUGO_ENVIRONMENT: production | |
HUGO_ENV: production | |
run: hugo --gc --minify --baseURL "${{ steps.pages.outputs.base_url }}/" | |
- name: Upload generated site | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: ./public | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy uploaded site to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v3 |