-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (47 loc) · 1.31 KB
/
dockerimage.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
name: Docker Build/Publish Image
on:
push:
branches: [ main ]
env:
DOCKER_IMAGE_NAME: "tdmproject/edge-shelly-handler"
DOCKER_IMAGE_TAG: ${{ github.run_number }}
PLATFORM: "linux/arm/v7"
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout the code
uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PWD }}
-
name: Build on main
if: github.ref == 'refs/heads/main'
run: |
docker buildx build \
--target=final \
-t ${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_IMAGE_TAG }} \
-t ${{ env.DOCKER_IMAGE_NAME }}:latest \
--platform ${{ env.PLATFORM }} \
-f docker/Dockerfile --output type=registry .
-
name: Build on develop
if: github.ref == 'refs/heads/develop'
run: |
docker buildx build \
--target=final \
-t ${{ env.DOCKER_IMAGE_NAME }}:dev-${{ env.DOCKER_IMAGE_TAG }} \
--platform ${{ env.PLATFORM }} \
-f docker/Dockerfile --output type=registry .