-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (45 loc) · 1.48 KB
/
pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Publish Pages
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: deploy
run: |
npm install uglify-js uglifycss -g
uglifyjs www/js/utatap.js -o www/js/utatap.js
uglifycss www/css/utatap.css > www/css/utatap.min.css
rm www/css/utatap.css
mv www/css/utatap.min.css www/css/utatap.css
rm data/README.md
ls -N1U data/vocal>data/vocal.txt
ls -N1U data/music>data/music.txt
cp -r data www
remote_addr=`git remote get-url --push origin`
commit_info=`git describe --all --always --long`
user_name=`git log -1 --pretty=format:'%an'`
user_email=`git log -1 --pretty=format:'%ae'`
cd www
git config --global init.defaultBranch gh-pages
git init
git config user.name ${user_name}
git config user.email ${user_email}
git add -A
git commit -m "auto deploy, $commit_info"
remote_addr=`echo $remote_addr | awk -F'://' '{print $2}'`
remote_addr=https://${user_name}:${{secrets.GITHUB_TOKEN}}@${remote_addr}
git remote add origin ${remote_addr}
git push origin HEAD:gh-pages --force