Skip to content

Commit 0f59bf8

Browse files
committed
add: image build action
1 parent 38cd462 commit 0f59bf8

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Docker Image CI
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
DOCKER_REGISTRY_NAME: ghcr.io
8+
DOCKER_IMAGE_NAME: ${{ github.repository }}
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Set up QEMU
15+
uses: docker/setup-qemu-action@v2
16+
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v2
19+
20+
- name: Login to Docker Hub
21+
uses: docker/login-action@v2
22+
with:
23+
registry: ${{ env.DOCKER_REGISTRY_NAME }}
24+
username: ${{ github.repository_owner }}
25+
password: ${{ github.token }}
26+
27+
- name: Extract metadata
28+
id: meta
29+
uses: docker/metadata-action@v3
30+
with:
31+
images: ${{ env.DOCKER_REGISTRY_NAME }}/${{ env.DOCKER_IMAGE_NAME }}
32+
33+
- name: Build and push
34+
uses: docker/build-push-action@v4
35+
with:
36+
push: true
37+
platforms: linux/amd64,linux/arm64
38+
tags: ${{ steps.meta.outputs.tags }}
39+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)