Skip to content

Commit 11e451c

Browse files
committed
Update docs workflow
Changes in the rancher github organization have disallowed the actions we use for publishing the docs to github pages. This change uses allowed actions to deploy the pages. Signed-off-by: Fredrik Lönnegren <[email protected]>
1 parent 7ee7afc commit 11e451c

File tree

1 file changed

+39
-25
lines changed

1 file changed

+39
-25
lines changed

.github/workflows/docs-publish.yaml

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,55 @@ on:
66
push:
77
branches:
88
- main
9-
schedule:
10-
- cron: 0 20 * * *
11-
12-
permissions:
13-
contents: write
149

1510
jobs:
16-
build-deploy:
11+
build:
1712
runs-on: ubuntu-latest
13+
env:
14+
HUGO_VERSION: 0.111.0
1815
steps:
19-
- name: Checkout Repo
16+
- name: Install Hugo CLI
17+
run: |
18+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
19+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
20+
- name: Install Dart Sass
21+
run: sudo snap install dart-sass
22+
- name: Checkout
2023
uses: actions/checkout@v4
2124
with:
2225
submodules: recursive
2326
fetch-depth: 0
24-
- name: Install Go
25-
uses: actions/setup-go@v5
26-
with:
27-
go-version-file: go.mod
28-
- name: Setup Hugo
29-
uses: peaceiris/actions-hugo@v3
30-
with:
31-
hugo-version: '0.111.0'
32-
extended: true
33-
- name: Install deps
27+
- name: Setup Pages
28+
id: pages
29+
uses: actions/configure-pages@v5
30+
- name: Install Node.js dependencies
31+
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
32+
- name: Install npm dependencies
3433
run: |
35-
npm install postcss-cli
36-
npm install autoprefixer
37-
- name: Build package docs
34+
npm install postcss-cli
35+
npm install autoprefixer
36+
- name: Build with Hugo
37+
env:
38+
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
39+
HUGO_ENVIRONMENT: production
3840
run: |
3941
make BASE_URL=https://rancher.github.io/elemental-toolkit build-docs
40-
- name: Deploy
41-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
42-
uses: JamesIves/github-pages-deploy-action@v4
42+
- name: Upload artifact
43+
uses: actions/upload-pages-artifact@v3
4344
with:
44-
branch: gh-pages
45-
folder: public
45+
path: ./public
4646

47+
deploy:
48+
permissions:
49+
pages: write
50+
id-token: write
51+
environment:
52+
name: gh-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
runs-on: ubuntu-latest
55+
needs: build
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
59+
id: deployment
60+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)