Skip to content

Commit 9fb2b0d

Browse files
authored
Merge pull request #60 from AzureCosmosDB/sajeetharan-gh-pat
Update GitHub Pages deployment workflow with PAT
2 parents d4656d5 + 3055cd0 commit 9fb2b0d

File tree

1 file changed

+10
-27
lines changed

1 file changed

+10
-27
lines changed

.github/workflows/deploy.yml

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
name: Deploy to GitHub Pages
1+
name: Deploy to GitHub Pages (with PAT)
22

33
on:
44
push:
55
branches:
66
- main
7-
# You can further define triggers if needed
8-
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
97

108
jobs:
11-
build:
12-
name: Build Docusaurus Site
9+
build-deploy:
1310
runs-on: ubuntu-latest
1411
steps:
15-
# Checkout the repository
12+
# Checkout source repo
1613
- uses: actions/checkout@v4
1714
with:
1815
fetch-depth: 0
1916

20-
# Set up Node.js
17+
# Setup Node.js
2118
- uses: actions/setup-node@v4
2219
with:
2320
node-version: 18
@@ -31,25 +28,11 @@ jobs:
3128
- name: Build website
3229
run: yarn build
3330

34-
# Upload the build folder for deployment
35-
- name: Upload Build Artifact
36-
uses: actions/upload-pages-artifact@v3
37-
with:
38-
path: build
39-
40-
deploy:
41-
name: Deploy to GitHub Pages
42-
needs: build
43-
runs-on: ubuntu-latest
44-
steps:
45-
# Deploy to GitHub Pages using PAT
31+
# Deploy using PAT to gh-pages branch
4632
- name: Deploy to GitHub Pages
47-
id: deployment
48-
uses: actions/deploy-pages@v4
33+
uses: peaceiris/actions-gh-pages@v3
4934
with:
50-
token: ${{ secrets.GH_PAT }} # <-- Use your PAT here
51-
52-
# Optional: specify environment for Pages
53-
environment:
54-
name: github-pages
55-
url: ${{ steps.deployment.outputs.page_url }}
35+
personal_token: ${{ secrets.GH_PAT }} # PAT secret
36+
publish_dir: ./build
37+
external_repository: <USERNAME>/<TARGET_REPO> # e.g. org/docs-site
38+
publish_branch: gh-pages

0 commit comments

Comments
 (0)