deploy upyun #536
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy upyun | |
on: | |
push: | |
branches: [ main ] | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: main | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '17.x' | |
cache: 'npm' | |
- name: Install Depend | |
run: npm install | |
- name: Update caniuse-lite Database | |
run: npm run update | |
- name: Commit files | |
run: | | |
git config --local user.name github-actions | |
git config --local user.email [email protected] | |
git commit -am "Auto Update browser latest DB" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.BOT_TOKEN }} | |
branch: main | |
- name: Build | |
run: npm run build | |
- name: Prepare the upload environment | |
run: wget --quiet -O- https://github.com/upyun/upx/releases/download/v0.3.6/upx_0.3.6_linux_x86_64.tar.gz | tar -xz | |
- name: Deploy Upyun | |
run: ./upx login ${{ secrets.BUCKET }} ${{ secrets.USERNAME }} ${{ secrets.PASSWORD }} && ./upx sync build/ --delete && ./upx logout | |