-
Notifications
You must be signed in to change notification settings - Fork 29
73 lines (64 loc) · 2.28 KB
/
docker-publish.yml
File metadata and controls
73 lines (64 loc) · 2.28 KB
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
name: Docker Build & Publish
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: 'Tag version (e.g., v1.0.0)'
required: true
type: string
env:
REGISTRY_IMAGE: yoanbernabeu/openbento
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
tags: |
# Tag 'latest' pour toutes les releases
type=raw,value=latest,enable={{is_default_branch}}
# Tag avec version complète (ex: 1.2.3)
type=semver,pattern={{version}}
# Tag avec version majeure.mineure (ex: 1.2)
type=semver,pattern={{major}}.{{minor}}
# Tag avec version majeure (ex: 1)
type=semver,pattern={{major}}
labels: |
org.opencontainers.image.title=OpenBento
org.opencontainers.image.description=A beautiful, open-source bento grid generator for creating stunning link-in-bio pages
org.opencontainers.image.vendor=Yoan Bernabeu
org.opencontainers.image.url=https://github.com/yoanbernabeu/openbento
org.opencontainers.image.documentation=https://github.com/yoanbernabeu/openbento/blob/main/README.md
org.opencontainers.image.licenses=MIT
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false