-
Notifications
You must be signed in to change notification settings - Fork 8
58 lines (51 loc) · 1.73 KB
/
publish-website.yaml
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
name: Publish website
on:
push:
branches: ['main']
tags: ['v*.*.*']
jobs:
github-pages:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.121.1'
extended: true
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Build website
if: github.ref_type == 'tag'
run: make website
- name: Deploy website
if: github.ref_type == 'tag'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website
publish_branch: gh-pages
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
# Redeploy the dev site after a tagged release, because actions-gh-pages
# will remove all files (including the "dev" dir) from the publish branch
# before pushing changes. This behavior can be avoided using
# "keep_files: true", but that approach could lead to hard-to-debug issues
# and is discouraged by the actions-gh-pages authors.
- name: Build dev website
env:
HUGO_BASEURL: 'https://kevin-hanselman.github.io/dud/dev'
run: make website
- name: Deploy dev website
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website
destination_dir: ./dev
publish_branch: gh-pages
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'