Repository navigation
95 lines (81 loc) · 2.3 KB
/
Copy pathdeploy.yml
File metadata and controls
95 lines (81 loc) · 2.3 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Deploy stellarvector.be to GitHub Pages
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
defaults:
run:
shell: bash
jobs:
build:
name: Build site
runs-on: ubuntu-latest
env:
HUGO_VERSION: "0.165.0"
HUGO_ENVIRONMENT: production
HUGO_ENV: production
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.26.x"
cache: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "24"
cache: "npm"
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: ${{ env.HUGO_VERSION }}
extended: true
- name: Cache Hugo resources
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/hugo_cache
key: ${{ runner.os }}-hugocache-${{ hashFiles('package-lock.json', 'go.sum') }}
restore-keys: |
${{ runner.os }}-hugocache-
- name: Install dependencies
run: npm ci
- name: Setup Pages
uses: actions/configure-pages@v5
# baseURL comes from the site config, never from the Pages output: the
# config is the one place the domain is written down.
# We run Hugo twice: once to generate hugo_stats.json, and once to build
# the final assets using those stats. This ensures Tailwind v4 doesn't
# purge classes used in templates.
- name: Build with Hugo
env:
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
HUGO_ENV: production
run: |
hugo --gc --ignoreCache --cleanDestinationDir
hugo --gc --minify --ignoreCache --cleanDestinationDir
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4