|
1 | | -# Sample workflow for building and deploying a Hugo site to GitHub Pages |
2 | 1 | name: Deploy Hugo site to Pages |
3 | 2 |
|
4 | 3 | on: |
5 | | - # Runs on pushes targeting the default branch |
6 | 4 | push: |
7 | 5 | branches: ["main"] |
8 | 6 |
|
9 | | - # Allows you to run this workflow manually from the Actions tab |
10 | 7 | workflow_dispatch: |
11 | 8 |
|
12 | | -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
13 | 9 | permissions: |
14 | 10 | contents: read |
15 | 11 | pages: write |
16 | 12 | id-token: write |
17 | 13 |
|
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. |
20 | 14 | concurrency: |
21 | 15 | group: "pages" |
22 | 16 | cancel-in-progress: false |
23 | 17 |
|
24 | | -# Default to bash |
25 | 18 | defaults: |
26 | 19 | run: |
27 | 20 | shell: bash |
28 | 21 |
|
29 | 22 | jobs: |
30 | | - # Build job |
31 | 23 | build: |
32 | 24 | runs-on: ubuntu-latest |
33 | 25 | env: |
34 | 26 | HUGO_VERSION: 0.128.0 |
35 | 27 | 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 |
42 | 28 | - name: Checkout |
43 | 29 | uses: actions/checkout@v4 |
44 | 30 | with: |
45 | 31 | 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 |
46 | 40 | - name: Setup Pages |
47 | 41 | id: pages |
48 | 42 | uses: actions/configure-pages@v5 |
49 | | - - name: Install Node.js dependencies |
50 | | - run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" |
51 | 43 | - name: Build with Hugo |
52 | 44 | env: |
53 | 45 | HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache |
54 | 46 | HUGO_ENVIRONMENT: production |
55 | 47 | run: | |
56 | | - hugo \ |
| 48 | + devbox run hugo \ |
57 | 49 | --minify \ |
58 | 50 | --baseURL "${{ steps.pages.outputs.base_url }}/" |
59 | 51 | - name: Upload artifact |
60 | 52 | uses: actions/upload-pages-artifact@v3 |
61 | 53 | with: |
62 | 54 | path: ./public |
63 | 55 |
|
64 | | - # Deployment job |
65 | 56 | deploy: |
66 | 57 | environment: |
67 | 58 | name: github-pages |
|
0 commit comments