Skip to content

Commit 265014e

Browse files
committed
fix: replace netlify deployment with GitHub Pages preview
Signed-off-by: varsha <varsha.narvi.07@gmail.com>
1 parent 67dc2d6 commit 265014e

1 file changed

Lines changed: 26 additions & 21 deletions

File tree

.github/workflows/preview.yml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ jobs:
88
deploy-preview:
99
name: Build and Deploy Preview
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
1114

1215
steps:
1316
- name: Checkout code
@@ -16,33 +19,35 @@ jobs:
1619
submodules: recursive
1720
fetch-depth: 0
1821

22+
- name: Setup Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: '1.24'
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: '20'
31+
cache: 'npm'
32+
33+
- name: Install Node.js dependencies
34+
run: npm ci
35+
1936
- name: Setup Hugo
2037
uses: peaceiris/actions-hugo@v3
2138
with:
22-
hugo-version: 'latest'
39+
hugo-version: '0.158.0'
2340
extended: true
2441

25-
- name: Install Node.js dependencies
26-
run: |
27-
if [ -f package.json ]; then
28-
npm ci
29-
fi
30-
3142
- name: Build Hugo site
32-
run: hugo --minify --baseURL "/"
43+
run: hugo --minify --baseURL "/academy-theme/pr-preview/pr-${{ github.event.number }}/"
3344

34-
- name: Deploy Preview to Netlify
35-
uses: nwtgck/actions-netlify@v3
45+
- name: Deploy Preview to GitHub Pages
46+
uses: rossjrw/pr-preview-action@v1
3647
with:
37-
publish-dir: './public'
38-
production-deploy: false
39-
github-token: ${{ secrets.GITHUB_TOKEN }}
40-
deploy-message: "Deploy preview for PR #${{ github.event.number }}"
41-
alias: deploy-preview-${{ github.event.number }}
42-
enable-pull-request-comment: true
43-
enable-commit-comment: false
44-
overwrites-pull-request-comment: true
48+
source-dir: ./public
49+
preview-branch: gh-pages
50+
umbrella-dir: pr-preview
51+
action: auto
4552
env:
46-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
47-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
48-
timeout-minutes: 10
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)