File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy Static Site
2+
3+ on :
4+ push :
5+ branches : [main]
6+ tags : ['v*']
7+
8+ jobs :
9+ deploy :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v4
15+ with :
16+ fetch-depth : 0
17+
18+ - name : Create clean deploy folder (exclude versions/, .github/)
19+ run : |
20+ mkdir deploy
21+ rsync -av --exclude=versions --exclude=.github --exclude=.git ./ ./deploy/
22+
23+ - name : Copy to versions/ on tag push
24+ if : startsWith(github.ref, 'refs/tags/')
25+ run : |
26+ TAG_NAME=${GITHUB_REF#refs/tags/}
27+ mkdir -p versions/JobPower_${TAG_NAME}
28+ rsync -av --exclude=versions --exclude=.github --exclude=.git ./ versions/JobPower_${TAG_NAME}/
29+
30+ - name : Commit version folder
31+ if : startsWith(github.ref, 'refs/tags/')
32+ run : |
33+ git config user.name github-actions
34+ git config user.email github-actions@github.com
35+ git add versions/JobPower_${TAG_NAME}
36+ git commit -m "Add JobPower version ${TAG_NAME}"
37+ git push
38+
39+ - name : Deploy to GitHub Pages
40+ uses : peaceiris/actions-gh-pages@v4
41+ with :
42+ github_token : ${{ secrets.GITHUB_TOKEN }}
43+ publish_branch : gh-pages
44+ publish_dir : ./deploy
You can’t perform that action at this time.
0 commit comments