-
Notifications
You must be signed in to change notification settings - Fork 11
31 lines (30 loc) · 1.17 KB
/
docker.image.yaml
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
name: Docker Image CI
on:
push:
branches: [ main, develop ]
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get Tag Version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: DockerHub Login
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Setup QEMU
uses: docker/[email protected]
with:
platforms: arm,arm64,amd64
- name: Docker Setup Buildx
uses: docker/[email protected]
- name: Build & Push Docker image (Latest)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/')
run: docker buildx build . --file Dockerfile -t kcapp/frontend:latest --platform=linux/arm,linux/arm64,linux/amd64 --push
- name: Build & Push Docker image (Release version)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: docker buildx build . --file Dockerfile -t kcapp/frontend:${{ env.RELEASE_VERSION }} --platform=linux/arm,linux/arm64,linux/amd64 --push