-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (43 loc) · 1.28 KB
/
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
---
name: "Build and Push docker image"
on:
push:
branches:
- "main"
tags:
- "v*.*.*"
jobs:
build-docker-image-job:
name: "Build and push docker image"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v4.1.1"
- name: "Extract metadata for image tags and labels"
id: "meta"
uses: "docker/metadata-action@v4.6.0"
with:
images: |
${{ secrets.DOCKER_REPOSITORY }}
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=raw,value=latest
- name: "Set up QEMU"
uses: "docker/setup-qemu-action@v2.2.0"
- name: "Set up Docker Buildx"
uses: "docker/setup-buildx-action@v2.10.0"
- name: "Login to Docker Hub"
uses: "docker/login-action@v2.2.0"
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
- name: "Build and push image"
uses: "docker/build-push-action@v3.3.1"
with:
file: "./docker/Dockerfile"
push: true
tags: "${{ steps.meta.outputs.tags }}"
labels: "${{ steps.meta.outputs.labels }}"
...