Skip to content

Commit 7f0d0fd

Browse files
add workflow
1 parent c7faca2 commit 7f0d0fd

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/deploy.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: deploy
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-node@v4
12+
with:
13+
node-version: '20.15.x'
14+
- name: setup git auth
15+
env:
16+
email: ${{ secrets.GH_EMAIL }}
17+
username: ${{ secrets.GH_USERNAME }}
18+
access_token: ${{ secrets.GH_ACCESS_TOKEN }}
19+
run: |
20+
git config --global credential.helper store
21+
echo "https://${access_token}:x-oauth-basic@github.com" > ~/.git-credentials
22+
git config --global user.email $email
23+
git config --global user.name $username
24+
- name: deploy to build
25+
run: |
26+
npm i
27+
NODE_ENV=production npm run build
28+
cd dist
29+
git init
30+
git add -A
31+
git commit -m "🚀 Deploy id ${GITHUB_RUN_ID}"
32+
git push -f "https://github.com/${GITHUB_REPOSITORY}.git" master:gh-pages

0 commit comments

Comments
 (0)