-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (37 loc) · 1.41 KB
/
nodejs.yaml
File metadata and controls
37 lines (37 loc) · 1.41 KB
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
name: Deploy
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "22"
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Setup qshell
run: |
wget -O qshell.tar.gz https://github.com/qiniu/qshell/releases/download/v2.16.0/qshell-v2.16.0-linux-amd64.tar.gz
tar zxvf qshell.tar.gz
rm -rf /github/home/.qshell/users/qiniu/qupload2
- name: login to qshell
run: |
./qshell account ${{ secrets.QINIU_ACCESS_KEY }} ${{ secrets.QINIU_ACCESS_SECRET }} qiniu
rm -rf /home/runner/.qshell/users/qiniu/listbucket2
rm -rf /home/runner/.qshell/users/qiniu/batchdelete
rm -rf /home/runner/.qshell/users/qiniu/qupload2
- name: delete old file
run: |
./qshell listbucket2 ${{ secrets.BUCKET }} --show-fields Key | grep -v 'Key' | grep -v '[I]' | awk '{print $1}' > old.list
./qshell batchdelete ${{ secrets.BUCKET }} -i old.list
- name: upload to qiniu cloud
run: ./qshell qupload2 --src-dir=./dist --bucket=${{ secrets.BUCKET }} --overwrite
- name: refresh cdn
run: ./qshell cdnrefresh --dirs -i cdn_refresh.list