Skip to content

Commit 5e723ed

Browse files
authored
Refactor deployment workflow for website
Updated the deployment workflow to use peaceiris/actions-gh-pages for publishing the website. Signed-off-by: TheCommCraft <[email protected]>
1 parent 184c5af commit 5e723ed

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

.github/workflows/deploy-website.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,16 @@ on:
1111
jobs:
1212
deploy:
1313
runs-on: ubuntu-latest
14-
1514
steps:
16-
- uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 0
19-
20-
- name: Set up Git
21-
run: |
22-
git config user.name "github-actions[bot]"
23-
git config user.email "github-actions[bot]@users.noreply.github.com"
15+
- name: Checkout main branch
16+
uses: actions/checkout@v4
2417

2518
- name: Deploy website directory to website branch
26-
run: |
27-
SRC_DIR="${GITHUB_WORKSPACE}/website"
28-
git switch --orphan website-tmp
29-
git rm -rf . || true
30-
cp -r "$SRC_DIR"/. .
31-
git add .
32-
git commit -m "Deploy website directory"
33-
git push origin website --force
19+
uses: peaceiris/actions-gh-pages@v4
20+
with:
21+
github_token: ${{ secrets.GITHUB_TOKEN }}
22+
publish_dir: ./website
23+
publish_branch: website
24+
user_name: 'github-actions[bot]'
25+
user_email: 'github-actions[bot]@users.noreply.github.com'
26+
commit_message: ${{ github.event.head_commit.message }}

0 commit comments

Comments
 (0)