Skip to content
This repository was archived by the owner on Jul 4, 2022. It is now read-only.

Commit ef03092

Browse files
authored
add docker image builder
1 parent a27e528 commit ef03092

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/build-image.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
on:
2+
push:
3+
tags:
4+
- "v*"
5+
6+
jobs:
7+
release-docker:
8+
name: release docker image
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
-
13+
name: Docker meta
14+
id: meta
15+
uses: docker/metadata-action@v4
16+
with:
17+
# list of Docker images to use as base name for tags
18+
images: |
19+
3n3a/m307
20+
# generate Docker tags based on the following events/attributes
21+
tags: |
22+
type=semver,pattern={{version}}
23+
type=sha
24+
-
25+
name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v2
27+
-
28+
name: Login to DockerHub
29+
uses: docker/login-action@v2
30+
with:
31+
username: ${{ secrets.DOCKERHUB_USERNAME }}
32+
password: ${{ secrets.DOCKERHUB_TOKEN }}
33+
-
34+
name: Build and push
35+
uses: docker/build-push-action@v3
36+
with:
37+
context: .
38+
push: true
39+
tags: ${{ steps.meta.outputs.tags }}
40+
labels: ${{ steps.meta.outputs.labels }}
41+
cache-from: type=registry,ref=3n3a/m307:latest
42+
cache-to: type=inline

0 commit comments

Comments
 (0)