-
Notifications
You must be signed in to change notification settings - Fork 90
54 lines (47 loc) · 1.47 KB
/
docker-build.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
name: Build and Push Docker Images
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
service: [worker-cli,server,worker]
include:
- service: server
dockerfile: docker/docker/server/Dockerfile
context: docker/docker/server
component: server
- service: worker
dockerfile: docker/docker/worker/Dockerfile
context: docker/docker/worker
component: worker
- service: worker-cli
dockerfile: docker/docker/worker-cli/Dockerfile
context: docker/docker/worker-cli
component: worker-cli
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
platforms: linux/amd64, linux/arm64
push: true
tags: |
sunsolution/betterscan-${{ matrix.component }}:latest
sunsolution/betterscan-${{ matrix.component }}:${{ github.sha }}