forked from apache/apisix-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (76 loc) · 2.63 KB
/
deploy-with-docker.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
name: Test and Deploy with Docker
on:
push:
branches:
- master
paths-ignore:
- 'docs/**'
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: docker/setup-buildx-action@v1
- uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-apisixdashboard-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-apisixdashboard-
${{ runner.os }}-buildx-
- name: Build Docker Image
uses: docker/build-push-action@v2
with:
load: true
tags: dashboard:ci
context: .
build-args: |
APISIX_DASHBOARD_VERSION=master
cache-from: |
type=local,src=/tmp/.buildx-cache
cache-to: |
type=local,dest=/tmp/.buildx-cache
- name: Modify Config
run: |
sed -i 's/127.0.0.1:2379/172.16.238.10:2379/' api/conf/conf.yaml
sed -i '[email protected]@0.0.0.0/0@' ./api/conf/conf.yaml
# At present, the docker CI is still running the code of the master branch
# So we need to configure `listen.host` so that it can be accessed outside docker
sed -i '/port: 9000/i\ host: 0.0.0.0' ./api/conf/conf.yaml
- name: build docker images
working-directory: ./api/test/docker-deploy
continue-on-error: true
run: |
docker buildx bake --load \
-f docker-compose.yaml \
--set *.cache-from=type=local,src=/tmp/.buildx-cache \
--set *.cache-to=type=local,dest=/tmp/.buildx-cache
- name: Run Docker Compose
working-directory: ./api/test/docker-deploy
run: |
docker-compose up -d
sleep 5
docker logs docker-deploy_managerapi_1
- name: Run Test
run: api/test/shell/manager_smoking.sh -s false
- uses: Azure/docker-login@v1
if: ${{ github.event_name == 'push' }}
with:
login-server: apisixacr.azurecr.cn
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Deploy
if: ${{ github.event_name == 'push' }}
run: |
docker tag dashboard:ci apisixacr.azurecr.cn/dashboard:${{ github.sha }}
docker push apisixacr.azurecr.cn/dashboard:${{ github.sha }}