-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (68 loc) · 2.35 KB
/
deploy-prod.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Deploy Aliyun oss
# Controls when the workflow will run
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Notify the build step is starting
uses: hasura/comment-progress@v2.2.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
commit-sha: ${{ github.sha }}
id: comment-progress
recreate: true
message: 'Starting deployment of this pull request...'
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Resolve Dependencies
run: |
npm i -g pnpm
pnpm i
# https://help.aliyun.com/document_detail/120072.htm
- name: Setup Aliyun OSS CLI
run: |
wget https://gosspublic.alicdn.com/ossutil/1.7.11/ossutil64
chmod 755 ossutil64
cp ./ossutil64 /usr/local/bin/
ossutil64 config -e https://oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.ALIYUN_ACCESS_KEY_ID }} -k ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }}
- name: Run build script
run: |
pnpm build
- name: Upload Production
run: |
ossutil64 cp -r -u dist/ oss://www-epb-wiki/
- name: Notify that the build was successful
uses: hasura/comment-progress@v2.2.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
commit-sha: ${{ github.sha }}
id: comment-progress
recreate: true
message: |
Successfully deployed to the following URLs:
## Live URLs
- https://www.epb.wiki/
## OSS Management Panel
- https://oss.console.aliyun.com/bucket/oss-cn-hangzhou/www-epb-wiki/object
- name: Notify that the build was failed
if: ${{ failure() }}
uses: hasura/comment-progress@v2.2.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
commit-sha: ${{ github.sha }}
id: comment-progress
message: ':x: Some errors occurred during the build process'
append: true