ProjectFirewatch/.github/workflows/hugo.yaml

65 lines
1.6 KiB
YAML
Raw Normal View History

2023-11-01 19:08:17 -07:00
# Sample workflow for building and deploying a Hugo site to GitHub Pages
2023-09-05 08:52:18 -07:00
name: Deploy Hugo site to Pages
on:
2023-11-01 19:08:17 -07:00
# Runs on pushes targeting the default branch
2023-09-05 08:52:18 -07:00
push:
branches:
2023-11-01 19:08:17 -07:00
- main
# Allows you to run this workflow manually from the Actions tab
2023-09-05 08:52:18 -07:00
workflow_dispatch:
2023-11-01 19:08:17 -07:00
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
# Default to bash
defaults:
run:
shell: bash
2023-09-05 08:52:18 -07:00
jobs:
2023-11-01 19:04:25 -07:00
build:
2023-09-05 08:52:18 -07:00
runs-on: ubuntu-latest
steps:
2023-11-01 19:20:35 -07:00
- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
2023-09-05 08:52:18 -07:00
with:
2023-11-01 19:20:35 -07:00
hugo-version: 'latest'
extended: true
- name: Build
2023-11-01 19:04:25 -07:00
run: |
hugo \
--gc \
--minify \
2023-11-01 19:20:35 -07:00
--baseURL "${{ steps.pages.outputs.base_url }}/"
2023-11-01 19:04:25 -07:00
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
2023-11-01 19:04:25 -07:00
path: ./public
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
2023-11-01 19:20:35 -07:00
uses: actions/deploy-pages@v2