-
Notifications
You must be signed in to change notification settings - Fork 666
107 lines (88 loc) · 2.97 KB
/
aurora.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
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
name: Aurora CI
on:
push:
branches: ["master"]
workflow_dispatch:
jobs:
aurora-springboot-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: "8"
distribution: "temurin"
cache: "maven"
- name: Build with Maven
run: |
cd aurora-springboot
mvn -B package --file pom.xml
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
context: aurora-springboot
tags: ${{secrets.DOCKER_USERNAME}}/aurora-springboot:latest
file: aurora-springboot/Dockerfile
- name: Update aurora-springboot container
run:
sshpass -p ${{secrets.REMOTE_HOST_B_PASSWORD}} ssh -o StrictHostKeyChecking=no
root@${{secrets.REMOTE_HOST_B_IP}} "cd /usr/local/aurora-springboot && sh aurora-springboot.sh"
aurora-vue-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "16"
cache: "npm"
cache-dependency-path: "aurora-vue/aurora-*/package-lock.json"
- name: Install aurora-blog dependencies
run: |
cd aurora-vue/aurora-blog
npm install
- name: Build aurora-blog
run: |
cd aurora-vue/aurora-blog
npm run build
- name: Install aurora-admin dependencies
run: |
cd aurora-vue/aurora-admin
npm install
- name: Build aurora-admin
run: |
cd aurora-vue/aurora-admin
npm run build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
context: aurora-vue
tags: ${{ secrets.DOCKER_USERNAME }}/aurora-vue:latest
file: aurora-vue/Dockerfile
- name: HostB transfer aurora-vue to tencent-registery
run:
sshpass -p ${{secrets.REMOTE_HOST_B_PASSWORD}} ssh -o StrictHostKeyChecking=no
root@${{secrets.REMOTE_HOST_B_IP}} "cd /usr/local/aurora-vue && sh aurora-vue.sh"
- name: Update aurora-vue container
run:
sshpass -p ${{secrets.REMOTE_HOST_A_PASSWORD}} ssh -o StrictHostKeyChecking=no
root@${{secrets.REMOTE_HOST_A_IP}} "cd /usr/local/aurora-vue && sh aurora-vue.sh"