-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (41 loc) · 1.28 KB
/
build.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
name: Build and Deploy
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Build 🔧
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: |
npm install
npm run build
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install coscmd
run: |
pip install coscmd
- name: Deploy CN 🚀
env:
COS_BUCKET_NAME: malagu-hk-1300141256
COS_BUCKET_LOCATION: ap-hongkong
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 3
retry_on: error
command: |
coscmd config -a ${{secrets.COS_SECRET_ID}} -s ${{secrets.COS_SECRET_KEY}} -b ${COS_BUCKET_NAME} -r ${COS_BUCKET_LOCATION} -m 10
coscmd upload -r ./dist/ /
- name: Deploy EN 🚀
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist