-
Notifications
You must be signed in to change notification settings - Fork 9
70 lines (61 loc) · 1.62 KB
/
deploy-hugo-task.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Deploy Website
# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
on:
push:
branches:
- main
paths:
- ".github/workflows/deploy-hugo-task.ya?ml"
- "site/**"
- "go.mod"
- "go.sum"
- "Taskfile.ya?ml"
- "tools.go"
repository_dispatch:
schedule:
# Run periodically to catch breakage caused by external changes.
- cron: "0 11 * * FRI"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
concurrency:
group: pages
cancel-in-progress: false
permissions: {}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install Task
run: |
go \
install \
github.com/go-task/task/v3/cmd/task
- name: Install website dependencies
run: task website:install-deps
- name: Build website
working-directory: ./site
run: hugo --minify
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./site/public
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deploy
uses: actions/deploy-pages@v4