File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ - ' ver/**'
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout Branch
15+ uses : actions/checkout@v2
16+
17+ - name : Setup Node.js
18+ uses : actions/setup-node@v2
19+ with :
20+ node-version : ' 14'
21+
22+ - name : Install Dependencies
23+ run : yarn install
24+
25+ - name : Build Docs
26+ run : ' yarn run docs:build'
27+
28+ - name : Push to Publish Branch
29+ run : |
30+ git config --global user.name 'github-actions[bot]'
31+ git config --global user.email 'github-actions[bot]@users.noreply.github.com'
32+
33+ if [ "${GITHUB_REF}" == "refs/heads/master" ]; then
34+ TARGET_DIR="."
35+ else
36+ VERSION=$(echo ${GITHUB_REF} | sed -e 's/refs\/heads\/ver\///')
37+ TARGET_DIR="${VERSION}"
38+ fi
39+
40+ git fetch origin publish
41+ git checkout -b publish origin/publish
42+
43+ mkdir -p ${TARGET_DIR}
44+ find "$TARGET_DIR" -mindepth 1 -not -regex '.*/[0-9]+\.[0-9]+\.[0-9]+$' -exec rm -rf {} +
45+ cp -r dist/* ${TARGET_DIR}/
46+
47+ git add .
48+ git commit -C ${GITHUB_SHA}
49+ git push origin publish
You can’t perform that action at this time.
0 commit comments