Skip to content

Commit 840efdc

Browse files
committed
added docker build and push.
1 parent c818cf8 commit 840efdc

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build & Push Multi-Arch Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*.*.*'
9+
10+
jobs:
11+
build-and-push:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v3
17+
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v2
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v2
22+
23+
- name: Log in to Docker Hub
24+
uses: docker/login-action@v2
25+
with:
26+
username: ${{ secrets.DOCKERHUB_USERNAME }}
27+
password: ${{ secrets.DOCKERHUB_TOKEN }}
28+
29+
- name: Extract Docker Image Metadata
30+
id: meta
31+
uses: docker/metadata-action@v4
32+
with:
33+
images: ${{ secrets.DOCKERHUB_USERNAME }}/checkin
34+
tags: |
35+
type=ref,event=branch,match=main->[latest]
36+
type=semver,pattern=v*.*.*->[{{version}}],[latest]
37+
labels: |
38+
org.opencontainers.image.source=${{ github.repository }}
39+
40+
- name: Build and Push Docker Image
41+
uses: docker/build-push-action@v4
42+
with:
43+
context: .
44+
file: ./Dockerfile
45+
push: true
46+
platforms: linux/amd64,linux/arm64,linux/arm/v7
47+
tags: ${{ steps.meta.outputs.tags }}
48+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)