You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.7 KiB
YAML
66 lines
1.7 KiB
YAML
concurrency:
|
|
cancel-in-progress: true
|
|
group: "pages"
|
|
defaults:
|
|
run:
|
|
shell: "bash"
|
|
jobs:
|
|
build:
|
|
name: "Build"
|
|
runs-on: "ubuntu-latest"
|
|
steps:
|
|
- name: "Checkout"
|
|
uses: "actions/checkout@v4"
|
|
- name: "Setup Hugo"
|
|
run: "sudo snap install hugo"
|
|
- name: "Setup Sass"
|
|
run: "sudo snap install dart-sass"
|
|
- id: "pages"
|
|
name: "Setup Pages"
|
|
uses: "actions/configure-pages@v5"
|
|
- name: "Build"
|
|
run: |
|
|
cd example
|
|
hugo --baseURL ${{ steps.pages.outputs.base_url }} --environment production --minify
|
|
- name: "Upload artifact"
|
|
uses: "actions/upload-pages-artifact@v3"
|
|
with:
|
|
path: "./example/public"
|
|
# build-windows:
|
|
# name: "Build Windows"
|
|
# runs-on: "windows-latest"
|
|
# steps:
|
|
# - name: "Checkout"
|
|
# uses: "actions/checkout@v4"
|
|
# - name: "Setup Hugo"
|
|
# run: "choco install hugo-extended"
|
|
# - name: "Setup Sass"
|
|
# run: "choco install dart-sass-embedded"
|
|
# - id: "pages"
|
|
# name: "Setup Pages"
|
|
# uses: "actions/configure-pages@v5"
|
|
# - name: "Build"
|
|
# run: |
|
|
# cd example
|
|
# hugo --baseURL ${{ steps.pages.outputs.base_url }} --minify
|
|
deploy:
|
|
environment:
|
|
name: "github-pages"
|
|
url: "${{ steps.pages.outputs.base_url }}"
|
|
if: "github.ref == 'refs/heads/master'"
|
|
name: "Deploy"
|
|
needs: "build"
|
|
runs-on: "ubuntu-latest"
|
|
steps:
|
|
- name: "Deploy Pages"
|
|
uses: "actions/deploy-pages@v4"
|
|
name: "GitHub Pages"
|
|
on:
|
|
push:
|
|
branches: ["**"]
|
|
workflow_dispatch:
|
|
permissions:
|
|
contents: "read"
|
|
id-token: "write"
|
|
pages: "write"
|