-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (42 loc) · 1.32 KB
/
deploy.yml
File metadata and controls
51 lines (42 loc) · 1.32 KB
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
name: GitHub Pages
on:
push:
branches:
- master # Set a branch to deploy
pull_request:
jobs:
deploy:
name: "Deploy Capa.io Pages"
runs-on: ubuntu-22.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: "Checkout source code"
uses: actions/checkout@v4
with:
submodules: recursive # Fetch the Docsy theme
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: "Setup Hugo"
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.145.0'
extended: true
- name: "Setup Node"
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: "Install project dependencies"
run: npm ci
- name: "Install Docsy theme dependencies"
run: cd themes/docsy && npm install
- name: "Create Hugo module directories for Docsy"
run: node themes/docsy/tools/mkdirp-hugo-mod.js themes
- name: "Build"
run: hugo --gc --minify --destination docs
- name: "Deploy"
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/master' }} # Deploy in master branch only
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs