-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (55 loc) · 2.07 KB
/
ci.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
name: CI
on:
push:
branches: ['master']
jobs:
client:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Client docker
run: |
docker build -t vue-vben-admin:dev ./vue-vben-admin/
- name: Login to Docker Registry
run: docker login -u ${{ secrets.HUAWEI_CLOUD_USERNAME }} -p ${{ secrets.HUAWEI_CLOUD_PASSWORD }} swr.cn-north-4.myhuaweicloud.com
- name: Push to Docker Registry
run: |
docker tag vue-vben-admin:dev swr.cn-north-4.myhuaweicloud.com/yuanjunjie/vue-vben-admin:dev
docker push swr.cn-north-4.myhuaweicloud.com/yuanjunjie/vue-vben-admin:dev
server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Server docker
run: |
docker build -t nest-admin:dev ./nest-admin/servers/
- name: Login to Docker Registry
run: docker login -u ${{ secrets.HUAWEI_CLOUD_USERNAME }} -p ${{ secrets.HUAWEI_CLOUD_PASSWORD }} swr.cn-north-4.myhuaweicloud.com
- name: Push to Docker Registry
run: |
docker tag nest-admin:dev swr.cn-north-4.myhuaweicloud.com/yuanjunjie/nest-admin:dev
docker push swr.cn-north-4.myhuaweicloud.com/yuanjunjie/nest-admin:dev
deploy:
needs: [client, server]
name: Deploy
runs-on: fd-dev
steps:
- uses: actions/checkout@v2
- name: Update docker images
run: |
sudo su
sudo docker pull swr.cn-north-4.myhuaweicloud.com/yuanjunjie/vue-vben-admin:dev
sudo docker pull swr.cn-north-4.myhuaweicloud.com/yuanjunjie/nest-admin:dev
- name: Login to Docker Registry
run: |
sudo su
sudo docker login -u ${{ secrets.HUAWEI_CLOUD_USERNAME }} -p ${{ secrets.HUAWEI_CLOUD_PASSWORD }} swr.cn-north-4.myhuaweicloud.com
- name: Run
run: |
sudo su
sudo docker compose -f ./docker-compose.yml up -d
- name: Clear Docker Cache
run: |
sudo su
sudo docker image prune -f
sudo docker volume prune -f