-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (32 loc) · 1.04 KB
/
build.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
name: Build & Publish
on:
push:
branches: [main]
workflow_dispatch:
pull_request:
# automatically cancel previous runs on the same PR
# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre/67939898#67939898
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.131.0'
extended: true
- name: Build
run: hugo --minify
- name: Deploy to Github Pages
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4.2.5
with:
branch: gh-pages # The branch the action should deploy to.
folder: public # The folder the action should deploy.
clean-exclude: ".nojekyll"