-
Notifications
You must be signed in to change notification settings - Fork 378
113 lines (108 loc) · 3.03 KB
/
deploy.yml
File metadata and controls
113 lines (108 loc) · 3.03 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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Deploy preview
on:
push:
branches:
- master
jobs:
cdn:
name: CDN
if: "! contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: bahmutov/npm-install@v1
- name: Set vue cli env
shell: bash
run: |
echo -e "\
VUE_APP_PUBLIC_PATH=/d2-admin-start-kit/preview/\
" > .env.preview.local
cat .env.preview.local | while read line
do
echo $line
done
- name: Build
run: yarn build:preview --report
- name: Setup qshell
uses: foxundermoon/setup-qshell@v1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
with:
qshell-version: '2.4.0'
- name: Test qshell
run: qshell version
- name: Login
run: qshell account ${{ secrets.AK }} ${{ secrets.SK }} GITHUB_ACTION
- name: CDN upload
run: |
qshell qupload2 \
--src-dir=$GITHUB_WORKSPACE/dist \
--bucket=d2-cdn \
--key-prefix=${GITHUB_REPOSITORY//*\//}/preview/ \
--overwrite=true \
--check-exists=true \
--check-hash=true \
--check-size=true \
--rescan-local=true \
--thread-count=32
- name: CDN refresh
run: |
echo "https://cdn.d2.pub/${GITHUB_REPOSITORY//*\//}/preview/" > cdnrefresh.txt
qshell cdnrefresh --dirs -i ./cdnrefresh.txt
ftp:
name: FTP
if: "! contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: bahmutov/npm-install@v1
- name: Set vue cli env
shell: bash
run: |
echo -e "\
VUE_APP_PUBLIC_PATH=/d2-admin-start-kit/preview/\
" > .env.preview.local
cat .env.preview.local | while read line
do
echo $line
done
- name: Build
run: yarn build:preview --report
- name: Deploy
uses: SamKirkland/FTP-Deploy-Action@2.0.0
env:
FTP_SERVER: ${{ secrets.FTP_SERVER }}
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
METHOD: sftp
PORT: ${{ secrets.FTP_PORT }}
LOCAL_DIR: dist
REMOTE_DIR: /www/d2-admin-start-kit/preview
ARGS: --delete --verbose --parallel=100
gh-pages:
name: Github Pages
if: "! contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: bahmutov/npm-install@v1
- name: Set vue cli env
shell: bash
run: |
echo -e "\
VUE_APP_PUBLIC_PATH=/d2-admin-start-kit/\
" > .env.preview.local
cat .env.preview.local | while read line
do
echo $line
done
- name: Build
run: yarn build:preview --report
- name: Deploy
uses: peaceiris/actions-gh-pages@v2
env:
PERSONAL_TOKEN: ${{ secrets.ACCESS_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./dist
with:
forceOrphan: true