-
Notifications
You must be signed in to change notification settings - Fork 70
105 lines (92 loc) · 2.87 KB
/
auto_build_docker_container.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
name: 自动构建docker镜像
on:
schedule:
- cron: "00 12 * * 0"
push:
branches: [ main ]
pull_request:
branches: [ main ]
watch:
types: started
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: akile monitor server meta
id: server_meta
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.DOCKER_USERNAME }}/akile_monitor_server
tags: |
type=raw,value=latest
{{date 'YYYY/MM/DD/hh/mm/ss'}}
- name: akile monitor frontend meta
id: fe_meta
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.DOCKER_USERNAME }}/akile_monitor_fe
tags: |
type=raw,value=latest
{{date 'YYYY/MM/DD/hh/mm/ss'}}
- name: akile monitor client meta
id: client_meta
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.DOCKER_USERNAME }}/akile_monitor_client
tags: |
type=raw,value=latest
{{date 'YYYY/MM/DD/hh/mm/ss'}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Build and push server
id: docker_build_server
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: true
platforms: linux/amd64,linux/arm64
target: server
tags: ${{ steps.server_meta.outputs.tags }}
labels: ${{ steps.server_meta.outputs.labels }}
- name: server Image digest
run: echo ${{ steps.docker_build_server.outputs.digest }}
- name: Build and push frontend
id: docker_build_fe
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: true
platforms: linux/amd64,linux/arm64
target: fe
tags: ${{ steps.fe_meta.outputs.tags }}
labels: ${{ steps.fe_meta.outputs.labels }}
- name: fe Image digest
run: echo ${{ steps.docker_build_fe.outputs.digest }}
- name: Build and push client
id: docker_build_client
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: true
platforms: linux/amd64,linux/arm64
target: client
tags: ${{ steps.client_meta.outputs.tags }}
labels: ${{ steps.client_meta.outputs.labels }}
- name: client Image digest
run: echo ${{ steps.docker_build_client.outputs.digest }}