Skip to content

Commit d2c9a93

Browse files
Update workflow
1 parent 35d7ad9 commit d2c9a93

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

.github/workflows/hugo.yaml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,25 @@
22
name: Deploy Hugo site to Pages
33

44
on:
5-
# Runs on pushes targeting the default branch
65
push:
76
branches:
87
- main
9-
10-
# Allows you to run this workflow manually from the Actions tab
118
workflow_dispatch:
129

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

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

25-
# Default to bash
2619
defaults:
2720
run:
2821
shell: bash
2922

3023
jobs:
31-
# Build job
3224
build:
3325
runs-on: ubuntu-latest
3426
env:
@@ -52,27 +44,31 @@ jobs:
5244
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
5345
- name: Build with Hugo
5446
env:
55-
# For maximum backward compatibility with Hugo modules
5647
HUGO_ENVIRONMENT: production
5748
HUGO_ENV: production
5849
run: |
5950
hugo \
6051
--gc \
6152
--minify \
62-
--baseURL "${{ steps.pages.outputs.base_url }}/"
63-
- name: Upload artifact
64-
uses: actions/upload-pages-artifact@v1
53+
--baseURL "${{ steps.pages.outputs.base_url }}/"
54+
- name: Upload build artifact
55+
uses: actions/upload-artifact@v3.1.2
6556
with:
57+
name: github-pages
6658
path: ./public
6759

68-
# Deployment job
6960
deploy:
7061
environment:
7162
name: github-pages
7263
url: ${{ steps.deployment.outputs.page_url }}
7364
runs-on: ubuntu-latest
7465
needs: build
7566
steps:
67+
- name: Download artifact
68+
uses: actions/download-artifact@v3
69+
with:
70+
name: github-pages
71+
path: ./public
7672
- name: Deploy to GitHub Pages
7773
id: deployment
78-
uses: actions/deploy-pages@v2
74+
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)