Skip to content

Commit 066f7d2

Browse files
authored
Merge pull request #19 from alpinebuster/dev
Tweaking `deploy-docs.yml`.
2 parents 06ca7b2 + 4e7e11d commit 066f7d2

File tree

2 files changed

+38
-17
lines changed

2 files changed

+38
-17
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# REF: `https://jaimestill.github.io/docusaur-gh/deploy`
1+
# REF: `https://docusaurus.io/docs/deployment#triggering-deployment-with-github-actions`
22
name: Deploy Docusaurus to GitHub Pages
33

44
on:
@@ -10,29 +10,48 @@ on:
1010

1111
defaults:
1212
run:
13-
working-directory: docs
13+
shell: bash
14+
working-directory: ./docs
1415

1516
jobs:
16-
deploy:
17-
name: Build Docusaurus to gh-pages
17+
build:
18+
name: Build Docusaurus
1819
runs-on: ubuntu-latest
1920
steps:
20-
- uses: actions/checkout@v3
21-
- uses: actions/setup-node@v3
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
- uses: actions/setup-node@v4
2225
with:
23-
node-version: 22
26+
node-version: 18
2427
cache: npm
25-
cache-dependency-path: docs/package-lock.json
2628

27-
- name: Install dependencies
29+
- name: Install Dependencies
2830
run: npm ci
29-
- name: Build website
31+
- name: Build Website
3032
run: npm run build
3133

32-
- name: Deploy to GitHub Pages
33-
uses: peaceiris/actions-gh-pages@v3
34+
- name: Upload Build Artifact
35+
uses: actions/upload-pages-artifact@v3
3436
with:
35-
github_token: ${{ secrets.GITHUB_TOKEN }}
36-
publish_dir: docs/build
37-
user_name: github-actions[bot]
38-
user_email: 41898282+github-actions[bot]@users.noreply.github.com
37+
path: build
38+
39+
deploy:
40+
name: Deploy to GitHub Pages
41+
needs: build
42+
43+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
44+
permissions:
45+
pages: write # to deploy to Pages
46+
id-token: write # to verify the deployment originates from an appropriate source
47+
48+
# Deploy to the github-pages environment
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
52+
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Deploy to GitHub Pages
56+
id: deployment
57+
uses: actions/deploy-pages@v4

docs/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ USE_SSH=true npm run deploy
3737
Not using SSH:
3838

3939
```bash
40-
GIT_USER=<Your GitHub username> npm run deploy
40+
git credential-cache exit
41+
42+
GIT_USER=<github_username> GITHUB_TOKEN=<token> npm run deploy
4143
```
4244

4345
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

0 commit comments

Comments
 (0)