-
Notifications
You must be signed in to change notification settings - Fork 8
60 lines (50 loc) · 1.33 KB
/
main.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
59
60
name: 'Publish to GitHub Pages'
on:
push:
branches:
- 'main'
workflow_dispatch: {}
concurrency:
group: 'main'
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: '[Deps] Pull in theme: hugo-book'
uses: actions/checkout@v3
with:
repository: 'alex-shpak/hugo-book'
ref: 'v10'
path: './src/themes/book'
- name: '[Deps] Set up Hugo in runtime context'
uses: peaceiris/actions-hugo@v2
with:
# TODO: obtain version from config/_default/module.json
hugo-version: '0.136.5'
extended: true
- name: 'Build site with Hugo'
run: |
hugo \
--config ./config \
--environment prod \
--destination ./.local/build \
--minify
- name: 'Upload build result as github-pages artifact'
uses: actions/upload-pages-artifact@v1
with:
path: './.local/build'
deploy:
runs-on: ubuntu-latest
needs: [ 'build' ]
permissions:
pages: 'write'
id-token: 'write'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: 'Deploy to GitHub Pages'
id: deployment
uses: actions/deploy-pages@v1