Skip to content

Commit c6bb67a

Browse files
authored
Merge pull request #97 from pataquets/add-docker-publish-image-action
Add Docker image publish Github action
2 parents fc7043c + 6a218ac commit c6bb67a

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish Docker image
2+
3+
on: push
4+
5+
jobs:
6+
buildx:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v3
11+
12+
- name: Docker meta
13+
id: meta
14+
uses: docker/metadata-action@v4
15+
with:
16+
images: ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}
17+
# generate Docker tags based on the following events/attributes
18+
tags: |
19+
type=ref,event=branch
20+
type=semver,pattern={{version}}
21+
type=semver,pattern={{major}}.{{minor}}
22+
type=semver,pattern={{major}}
23+
24+
# Required if building multi-arch images
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@v2
27+
28+
- id: buildx
29+
name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v2
31+
with:
32+
buildkitd-flags: --debug
33+
install: true
34+
35+
- name: Login to DockerHub
36+
uses: docker/login-action@v2
37+
with:
38+
username: ${{ secrets.DOCKERHUB_USERNAME }}
39+
password: ${{ secrets.DOCKERHUB_TOKEN }}
40+
41+
- name: Build and push
42+
uses: docker/build-push-action@v3
43+
with:
44+
platforms: linux/amd64,linux/arm64,linux/386
45+
push: true
46+
labels: ${{ steps.meta.outputs.labels }}
47+
tags: ${{ steps.meta.outputs.tags }}
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)