forked from complytime/website
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (65 loc) · 1.93 KB
/
Copy pathdeploy-gh-pages.yml
File metadata and controls
80 lines (65 loc) · 1.93 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
name: Deploy Hugo to GitHub Pages
on:
push:
branches: main
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
with:
node-version: '22'
- name: Setup Hugo
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f
with:
hugo-version: '0.155.1'
extended: true
- name: Install dependencies
run: npm ci
- name: Go vet
run: go vet ./...
- name: Check formatting
run: |
unformatted=$(gofmt -l ./cmd/sync-content/)
if [ -n "$unformatted" ]; then
echo "::error::Unformatted Go files:"
echo "$unformatted"
exit 1
fi
- name: Run tests
run: go test -race ./cmd/sync-content/...
- name: Sync content
run: go run ./cmd/sync-content --org complytime --config sync-config.yaml --lock .content-lock.json --write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: hugo --minify --gc
- name: Upload artifact
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b
with:
path: ./public
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5