2023-01-27 13:13:10 +00:00
|
|
|
# https://github.com/actions/starter-workflows/blob/main/pages/hugo.yml
|
|
|
|
name: Deploy Hugo site to Pages
|
2020-07-21 19:08:28 +01:00
|
|
|
|
|
|
|
on:
|
2020-09-24 06:53:27 +01:00
|
|
|
push:
|
2020-09-24 07:48:18 +01:00
|
|
|
paths-ignore:
|
2022-03-27 15:09:44 +01:00
|
|
|
- "README.md"
|
2020-09-24 06:53:27 +01:00
|
|
|
branches:
|
|
|
|
- master
|
2020-07-21 19:08:28 +01:00
|
|
|
|
2023-01-27 13:13:10 +00:00
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
|
|
|
|
# Allow one concurrent deployment
|
|
|
|
concurrency:
|
|
|
|
group: "pages"
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
|
2020-07-21 19:08:28 +01:00
|
|
|
jobs:
|
2023-01-27 13:13:10 +00:00
|
|
|
build:
|
2020-07-21 19:08:28 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-04-12 16:30:31 +01:00
|
|
|
- uses: actions/checkout@v3
|
2020-07-21 19:08:28 +01:00
|
|
|
with:
|
2022-04-14 04:38:07 +01:00
|
|
|
fetch-depth: 1
|
2023-01-27 13:13:10 +00:00
|
|
|
|
|
|
|
- name: Configure Pages
|
|
|
|
id: pages
|
|
|
|
uses: actions/configure-pages@v3
|
2020-07-25 07:37:01 +01:00
|
|
|
|
2022-04-12 16:30:31 +01:00
|
|
|
- name: Setup Hugo
|
2020-07-21 19:08:28 +01:00
|
|
|
uses: peaceiris/actions-hugo@v2
|
|
|
|
with:
|
2023-01-27 13:13:10 +00:00
|
|
|
hugo-version: 'latest'
|
2022-09-03 05:20:03 +01:00
|
|
|
extended: true
|
2020-07-21 19:08:28 +01:00
|
|
|
|
|
|
|
- name: Build
|
2023-01-27 13:13:10 +00:00
|
|
|
run: |
|
|
|
|
hugo \
|
|
|
|
--minify --verbose -D \
|
|
|
|
--buildFuture \
|
|
|
|
--environment production \
|
|
|
|
--themesDir ../.. --theme hugo-PaperModX \
|
|
|
|
--baseURL "${{ steps.pages.outputs.base_url }}/"
|
|
|
|
working-directory: exampleSite
|
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-pages-artifact@v1
|
2020-07-21 19:08:28 +01:00
|
|
|
with:
|
2023-01-27 13:13:10 +00:00
|
|
|
path: ./exampleSite/public
|
|
|
|
|
|
|
|
# Deployment job
|
|
|
|
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
|
|
|
|
uses: actions/deploy-pages@v1
|