Skip to content

Commit 234c05c

Browse files
Deploy on pull request to development (#7)
1 parent 6a3660f commit 234c05c

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

.github/workflows/hugo.yaml

+23-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
# Sample workflow for building and deploying a Hugo site to GitHub Pages
2-
name: Deploy Hugo site to Pages
2+
name: Deploy documentation to Github Pages
33

44
on:
55
# Runs on pushes targeting the default branch
6-
push:
6+
pull_request:
7+
branches:
8+
- development
9+
push:
710
branches:
811
- master
912

10-
# Allows you to run this workflow manually from the Actions tab
11-
workflow_dispatch:
12-
1313
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1414
permissions:
1515
contents: read
1616
pages: write
1717
id-token: write
1818

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.
2119
concurrency:
2220
group: "pages"
2321
cancel-in-progress: false
@@ -29,22 +27,32 @@ defaults:
2927

3028
jobs:
3129
# Build job
32-
build:
30+
build-documentation:
3331
runs-on: ubuntu-latest
3432
env:
3533
HUGO_VERSION: 0.123.7
3634
steps:
35+
3736
- name: Install Hugo CLI
3837
run: |
3938
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
4039
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
4140
- name: Install Dart Sass
4241
run: sudo snap install dart-sass
42+
- name: Use Node.js
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: '20.x'
4346
- name: Checkout
4447
uses: actions/checkout@v4
4548
with:
4649
submodules: recursive
4750
fetch-depth: 0
51+
- name: Update npm
52+
run: npm install -g npm@10.5.0
53+
- name: Install dependencies
54+
run: npm install
55+
working-directory: docs
4856
- name: Setup Pages
4957
id: pages
5058
uses: actions/configure-pages@v4
@@ -55,25 +63,26 @@ jobs:
5563
# For maximum backward compatibility with Hugo modules
5664
HUGO_ENVIRONMENT: production
5765
HUGO_ENV: production
66+
working-directory: docs
5867
run: |
5968
hugo \
6069
--gc \
6170
--minify \
6271
--baseURL "${{ steps.pages.outputs.base_url }}/"
6372
- name: Upload artifact
64-
uses: actions/upload-pages-artifact@v2
73+
uses: actions/upload-pages-artifact@v3
6574
with:
66-
path: ./public
75+
path: ./docs/public
6776

6877
# Deployment job
69-
deploy:
78+
deploy-to-pages:
7079
environment:
71-
name: github-pages
80+
name: development-pages
7281
url: ${{ steps.deployment.outputs.page_url }}
7382
runs-on: ubuntu-latest
74-
needs: build
83+
needs: build-documentation
7584
steps:
7685
- name: Deploy to GitHub Pages
7786
id: deployment
78-
uses: actions/deploy-pages@v3
87+
uses: actions/deploy-pages@v4
7988

docs/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/google/docsy-example
22

33
go 1.12
44

5-
require github.com/google/docsy v0.8.0 // indirect
5+
require github.com/google/docsy v0.9.1 // indirect

docs/go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ github.com/FortAwesome/Font-Awesome v0.0.0-20230327165841-0698449d50f2 h1:Uv1z5E
22
github.com/FortAwesome/Font-Awesome v0.0.0-20230327165841-0698449d50f2/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
33
github.com/google/docsy v0.8.0 h1:RgHyKRTo8YwScMThrf01Ky2yCGpUS1hpkspwNv6szT4=
44
github.com/google/docsy v0.8.0/go.mod h1:FqTNN2T7pWEGW8dc+v5hQ5VF29W5uaL00PQ1LdVw5F8=
5+
github.com/google/docsy v0.9.1 h1:+jqges1YCd+yHeuZ1BUvD8V8mEGVtPxULg5j/vaJ984=
6+
github.com/google/docsy v0.9.1/go.mod h1:saOqKEUOn07Bc0orM/JdIF3VkOanHta9LU5Y53bwN2U=
57
github.com/twbs/bootstrap v5.2.3+incompatible h1:lOmsJx587qfF7/gE7Vv4FxEofegyJlEACeVV+Mt7cgc=
68
github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=

0 commit comments

Comments
 (0)