56 lines (47 loc) · 1.38 KB
/
deploy-dockerhub.yml
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
49
50
51
52
53
54
55
56
name: Deploy
permissions: read-all
on:
push:
branches:
- main
tags:
- "v*.*.*"
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
- name: Docker tags
uses: docker/metadata-action@v4.6.0
id: tags
with:
images: |
matejkosiarcik/planckpng
tags: |
type=edge,branch=main
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
# :latest tag is added automatically on type=semver
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.2.0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.9.1
- name: Debug logs
run: |
printf "Platforms:\n%s\n" "${{ steps.buildx.outputs.platforms }}"
printf "Tags:\n%s\n" "${{ steps.tags.outputs.tags }}"
- name: Login to DockerHub
uses: docker/login-action@v2.2.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Publish
uses: docker/build-push-action@v4.1.1
with:
platforms: linux/amd64
push: true
tags: ${{ steps.tags.outputs.tags }}