52 lines
1.1 KiB
YAML
52 lines
1.1 KiB
YAML
name: Deploy Hugo site to Pages
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main # Set a branch to deploy
|
|
schedule:
|
|
- cron: '15 1 * * *' # 01:15 UTC daily
|
|
pull_request:
|
|
|
|
workflow_dispatch:
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- 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
|
|
with:
|
|
hugo-version: 'latest'
|
|
extended: true
|
|
|
|
- name: Build
|
|
run: |
|
|
hugo \
|
|
--gc \
|
|
--minify \
|
|
--baseURL "${{ steps.pages.outputs.base_url }}/"
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v1
|
|
with:
|
|
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
|
|
uses: actions/deploy-pages@v2
|