Skip to content

Commit db52412

Browse files
committed
Add GitHub Actions workflow for deployment
1 parent a6d7410 commit db52412

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy Projects to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Prepare deployment folder
16+
run: |
17+
mkdir gh-pages
18+
cp -r docs/* gh-pages/
19+
for d in */ ; do
20+
if [[ "$d" != "docs/" && -f "$d/index.html" ]]; then
21+
cp -r "$d" gh-pages/
22+
fi
23+
done
24+
25+
- name: Deploy to GitHub Pages
26+
uses: peaceiris/actions-gh-pages@v4
27+
with:
28+
github_token: ${{ secrets.GITHUB_TOKEN }}
29+
publish_dir: ./gh-pages
30+
publish_branch: gh-pages

0 commit comments

Comments
 (0)