Skip to content

Commit 7c7ad6f

Browse files
authored
Merge pull request #5 from mongodb-developer/fix-deployment
Removed TOKEN dependency
2 parents d20026d + 9c810df commit 7c7ad6f

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

.github/workflows/deploy.yml

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ on:
44
push:
55
branches:
66
- main
7-
# Review gh actions docs if you want to further define triggers, paths, etc
8-
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
7+
workflow_dispatch: {}
98

109
jobs:
11-
deploy:
12-
name: Deploy to GitHub Pages
10+
build:
11+
name: Build Docusaurus
1312
runs-on: ubuntu-latest
1413
steps:
1514
- uses: actions/checkout@v4
16-
- uses: actions/setup-node@v3
15+
with:
16+
fetch-depth: 0
17+
- uses: actions/setup-node@v4
1718
with:
1819
node-version: 20
1920
cache: npm
@@ -23,11 +24,27 @@ jobs:
2324
- name: Build website
2425
run: npm run build
2526

26-
# Popular action to deploy to GitHub Pages:
27-
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
28-
- name: Deploy to GitHub Pages
29-
uses: peaceiris/actions-gh-pages@v3
27+
- name: Upload Build Artifact
28+
uses: actions/upload-pages-artifact@v3
3029
with:
31-
github_token: ${{ secrets.GH_TOKEN }}
32-
# Build output to publish to the `gh-pages` branch:
33-
publish_dir: ./build
30+
path: build
31+
32+
deploy:
33+
name: Deploy to GitHub Pages
34+
needs: build
35+
36+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
37+
permissions:
38+
pages: write # to deploy to Pages
39+
id-token: write # to verify the deployment originates from an appropriate source
40+
41+
# Deploy to the github-pages environment
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)