forked from axelo/yamaha-sound-program-by-source
-
-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (76 loc) · 2.52 KB
/
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Some refs :
# - Starting : https://docs.docker.com/ci-cd/github-actions/
# - More details here : https://github.com/marketplace/actions/build-and-push-docker-images#update-dockerhub-repo-description
# - Variables (contexts) : https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context
name: Docker Hub
on:
push:
branches:
- master
tags:
- 'v*.*.*'
pull_request:
branches:
- 'master'
jobs:
build-publish:
name: Build, Publish
environment: prod
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: nicolabs/musiccast-repairkit
# See https://github.com/docker/metadata-action#tags-input
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up QEMU for multiarch
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push image
id: docker_build_alpine
uses: docker/build-push-action@v4.2.0
with:
context: ./
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build_alpine.outputs.digest }}
post:
name: Update repo
needs:
- build-publish
environment: prod
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
# https://github.com/peter-evans/dockerhub-description
- name: Update repo description
uses: peter-evans/dockerhub-description@v3.4.1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
repository: nicolabs/musiccast-repairkit