Skip to content

Update pages.yml

Update pages.yml #28

Workflow file for this run

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