Skip to content

Commit 87e3ec1

Browse files
committed
rewrite deploy action to use devbox
1 parent fa3f965 commit 87e3ec1

File tree

3 files changed

+78
-20
lines changed

3 files changed

+78
-20
lines changed

.github/workflows/hugo.yaml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,58 @@
1-
# Sample workflow for building and deploying a Hugo site to GitHub Pages
21
name: Deploy Hugo site to Pages
32

43
on:
5-
# Runs on pushes targeting the default branch
64
push:
75
branches: ["main"]
86

9-
# Allows you to run this workflow manually from the Actions tab
107
workflow_dispatch:
118

12-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
139
permissions:
1410
contents: read
1511
pages: write
1612
id-token: write
1713

18-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2014
concurrency:
2115
group: "pages"
2216
cancel-in-progress: false
2317

24-
# Default to bash
2518
defaults:
2619
run:
2720
shell: bash
2821

2922
jobs:
30-
# Build job
3123
build:
3224
runs-on: ubuntu-latest
3325
env:
3426
HUGO_VERSION: 0.128.0
3527
steps:
36-
- name: Install Hugo CLI
37-
run: |
38-
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
39-
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
40-
- name: Install Dart Sass
41-
run: sudo snap install dart-sass
4228
- name: Checkout
4329
uses: actions/checkout@v4
4430
with:
4531
submodules: recursive
32+
- name: Install devbox
33+
uses: jetify-com/[email protected]
34+
# - name: Install Hugo CLI
35+
# run: |
36+
# wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
37+
# && sudo dpkg -i ${{ runner.temp }}/hugo.deb
38+
# - name: Install Dart Sass
39+
# run: sudo snap install dart-sass
4640
- name: Setup Pages
4741
id: pages
4842
uses: actions/configure-pages@v5
49-
- name: Install Node.js dependencies
50-
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
5143
- name: Build with Hugo
5244
env:
5345
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
5446
HUGO_ENVIRONMENT: production
5547
run: |
56-
hugo \
48+
devbox run hugo \
5749
--minify \
5850
--baseURL "${{ steps.pages.outputs.base_url }}/"
5951
- name: Upload artifact
6052
uses: actions/upload-pages-artifact@v3
6153
with:
6254
path: ./public
6355

64-
# Deployment job
6556
deploy:
6657
environment:
6758
name: github-pages

devbox.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.7/.schema/devbox.schema.json",
3-
"packages": ["hugo@latest"],
2+
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.7/.schema/devbox.schema.json",
3+
"packages": [
4+
"hugo@latest",
5+
"dart-sass@latest"
6+
],
47
"shell": {
58
"scripts": {
69
"hugo": [

devbox.lock

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,70 @@
11
{
22
"lockfile_version": "1",
33
"packages": {
4+
"dart-sass@latest": {
5+
"last_modified": "2025-02-07T11:26:36Z",
6+
"resolved": "github:NixOS/nixpkgs/d98abf5cf5914e5e4e9d57205e3af55ca90ffc1d#dart-sass",
7+
"source": "devbox-search",
8+
"version": "1.83.4",
9+
"systems": {
10+
"aarch64-darwin": {
11+
"outputs": [
12+
{
13+
"name": "out",
14+
"path": "/nix/store/1x7743dc4wiimx92px41dgg8qi8i52vm-dart-sass-1.83.4",
15+
"default": true
16+
},
17+
{
18+
"name": "pubcache",
19+
"path": "/nix/store/gd09jpm0dn9zjdzmxvf8ka90bjslq5sh-dart-sass-1.83.4-pubcache"
20+
}
21+
],
22+
"store_path": "/nix/store/1x7743dc4wiimx92px41dgg8qi8i52vm-dart-sass-1.83.4"
23+
},
24+
"aarch64-linux": {
25+
"outputs": [
26+
{
27+
"name": "out",
28+
"path": "/nix/store/rbj541mj5azjs8zavbflh7awxg9aj44g-dart-sass-1.83.4",
29+
"default": true
30+
},
31+
{
32+
"name": "pubcache",
33+
"path": "/nix/store/gcrbdxki39b14gh5fvjc5pqlrwfmyzbq-dart-sass-1.83.4-pubcache"
34+
}
35+
],
36+
"store_path": "/nix/store/rbj541mj5azjs8zavbflh7awxg9aj44g-dart-sass-1.83.4"
37+
},
38+
"x86_64-darwin": {
39+
"outputs": [
40+
{
41+
"name": "out",
42+
"path": "/nix/store/s4vza6xach0ia724z2dlrfzkwh4n2dbb-dart-sass-1.83.4",
43+
"default": true
44+
},
45+
{
46+
"name": "pubcache",
47+
"path": "/nix/store/hi8msk3592xb7w2xkbcff1nr814bqvdp-dart-sass-1.83.4-pubcache"
48+
}
49+
],
50+
"store_path": "/nix/store/s4vza6xach0ia724z2dlrfzkwh4n2dbb-dart-sass-1.83.4"
51+
},
52+
"x86_64-linux": {
53+
"outputs": [
54+
{
55+
"name": "out",
56+
"path": "/nix/store/dy1419lys8b5sahhf4wx4cr9i0dqd4nj-dart-sass-1.83.4",
57+
"default": true
58+
},
59+
{
60+
"name": "pubcache",
61+
"path": "/nix/store/mwf5xlbdpm2qvlqp6kv4k20mnim3vfpa-dart-sass-1.83.4-pubcache"
62+
}
63+
],
64+
"store_path": "/nix/store/dy1419lys8b5sahhf4wx4cr9i0dqd4nj-dart-sass-1.83.4"
65+
}
66+
}
67+
},
468
"hugo@latest": {
569
"last_modified": "2025-02-07T11:26:36Z",
670
"resolved": "github:NixOS/nixpkgs/d98abf5cf5914e5e4e9d57205e3af55ca90ffc1d#hugo",

0 commit comments

Comments
 (0)