-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1.31 KB
/
publish-docker.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# publish images to Docker Hub when a new tag is pushed to main
---
name: Publish Docker images
"on":
push:
tags: ["v*.*.*"]
jobs:
docker-publish:
name: Publish image to Docker Hub
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Initialize Docker metadata
id: meta
uses: docker/[email protected]
with:
images: |
${{ github.repository }}
tags: |
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{version}}
type=raw,value=latest,enable={{is_default_branch}}
type=sha
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Upload image to Docker Hub
uses: docker/[email protected]
with:
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}