-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (55 loc) · 1.81 KB
/
publish.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
name: Build and Publish
on:
push:
tags:
- '*'
permissions:
contents: read
jobs:
publish:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to build
images: |
contane/foreman
# generate Docker tags: X.Y.Z, X.Y, X, latest
# Note: "latest" is automatically included with type=semver
tags: |
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: contane
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
id: docker-build
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Image digest
run: echo ${{ steps.docker-build.outputs.digest }}
# See: https://docs.docker.com/build/ci/github-actions/update-dockerhub-desc/
- name: Update DockerHub description
uses: peter-evans/dockerhub-description@e98e4d1628a5f3be2be7c231e50981aee98723ae # v4.0.0
with:
username: contane
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
repository: contane/foreman
short-description: ${{ github.event.repository.description }}
enable-url-completion: true