Skip to content

Commit 4f8e43b

Browse files
committed
Fix deploy workflow — use git push directly for fine-grained token compatibility
1 parent 30a5fe7 commit 4f8e43b

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@ jobs:
88
deploy:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
12-
with:
13-
submodules: true
14-
15-
- name: Setup Hugo
16-
uses: peaceiris/actions-hugo@v3
17-
with:
18-
hugo-version: latest
19-
extended: true
11+
- name: Checkout source
12+
uses: actions/checkout@v4
2013

2114
- name: Setup Go
2215
uses: actions/setup-go@v5
@@ -28,6 +21,11 @@ jobs:
2821
with:
2922
node-version: "20"
3023

24+
- name: Install Hugo Extended
25+
run: |
26+
wget -O hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.146.0/hugo_extended_0.146.0_linux-amd64.deb
27+
sudo dpkg -i hugo.deb
28+
3129
- name: Install dependencies
3230
run: |
3331
hugo mod tidy
@@ -37,10 +35,13 @@ jobs:
3735
- name: Build site
3836
run: hugo --minify
3937

40-
- name: Deploy to GitHub Pages repo
41-
uses: peaceiris/actions-gh-pages@v4
42-
with:
43-
personal_token: ${{ secrets.DEPLOY_TOKEN }}
44-
external_repository: Vibhu2/vibhu2.github.io
45-
publish_branch: main
46-
publish_dir: ./public
38+
- name: Deploy to vibhu2.github.io
39+
run: |
40+
git config --global user.name "github-actions[bot]"
41+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
42+
git clone https://x-access-token:${{ secrets.DEPLOY_TOKEN }}@github.com/Vibhu2/vibhu2.github.io.git deploy-repo
43+
cp -r public/. deploy-repo/
44+
cd deploy-repo
45+
git add .
46+
git diff --cached --quiet || git commit -m "Deploy: ${{ github.sha }}"
47+
git push https://x-access-token:${{ secrets.DEPLOY_TOKEN }}@github.com/Vibhu2/vibhu2.github.io.git main

0 commit comments

Comments
 (0)