Skip to content

Commit 5ce7e32

Browse files
author
奇淼(piexlmax
authored
Merge pull request flipped-aurora#850 from tscuite/master
修改docker配置文件中mysql连接方式,增加自动构建tag
2 parents 896b01b + 48b4bf8 commit 5ce7e32

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.github/workflows/devops.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: devops
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
workflow_dispatch:
7+
jobs:
8+
build:
9+
name: Build
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: ['16.x']
14+
go-version: ['1.16']
15+
steps:
16+
- name: Check out branch
17+
uses: actions/checkout@v2
18+
- name: Sed Config
19+
shell: bash
20+
run: |
21+
git branch
22+
ls -l
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v2.1.2
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
- name: Build-Node
28+
run: |
29+
cd web/ && yarn install && yarn run build
30+
- name: Use Go ${{ matrix.go-version }}
31+
uses: actions/setup-go@v1
32+
with:
33+
go-version: ${{ matrix.go-version }}
34+
- name: Build-go
35+
run: |
36+
cd server/ && go mod tidy && go build && mkdir ../web/ser && mv server ../web/ser/ && cd ../web/ser/ && ls -s
37+
- name: restart
38+
env:
39+
KEY: ${{ secrets.KEY }}
40+
HOST: ${{ secrets.HOST }}
41+
USER: ${{ secrets.USER }}
42+
PROT: ${{ secrets.PROT }}
43+
MKDIR: ${{ secrets.MKDIR }}
44+
run: |
45+
mkdir -p ~/.ssh/ && echo "$KEY" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
46+
ssh-keyscan github.com >> ~/.ssh/known_hosts
47+
scp -P ${PROT} -o StrictHostKeyChecking=no -r web/dist/* ${USER}@${HOST}:${MKDIR}dist/
48+
scp -P ${PROT} -o StrictHostKeyChecking=no -r web/ser/* ${USER}@${HOST}:${MKDIR}
49+
ssh -p ${PROT} -o StrictHostKeyChecking=no ${USER}@${HOST} "cd ${MKDIR}resource/ && rm -rf ${MKDIR}resource/*"
50+
scp -P ${PROT} -o StrictHostKeyChecking=no -r server/resource/* ${USER}@${HOST}:${MKDIR}resource/
51+
ssh -p ${PROT} -o StrictHostKeyChecking=no ${USER}@${HOST} "cd ${MKDIR} && bash restart.sh > /dev/null 2>&1 &"

server/config.docker.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ captcha:
5555
# mysql connect configuration
5656
mysql:
5757
path: ''
58+
port: ''
5859
config: ''
5960
db-name: ''
6061
username: ''

0 commit comments

Comments
 (0)