-
Notifications
You must be signed in to change notification settings - Fork 48
74 lines (69 loc) · 2.46 KB
/
build-job.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
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
name: Build job
on:
workflow_call:
inputs:
dockerfile:
description: Path to the Dockerfile to build
required: true
type: string
tags:
description: Tags to apply to the image
required: true
type: string
image-version:
description: Value for org.opencontainers.image.version label
required: true
type: string
image-revision:
description: Value for org.opencontainers.image.revision label
default: ${{ github.sha }}
type: string
ref:
description: Git reference to build
default: ${{ github.ref }}
type: string
secrets:
DOCKERHUB_USERNAME:
description: DockerHub username
required: true
DOCKERHUB_PASSWORD:
description: DockerHub password
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
show-progress: false
# See https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# See https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# See https://github.com/docker/login-action
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
# See https://github.com/docker/build-push-action
- name: Build and push image
uses: docker/build-push-action@v2
with:
file: ${{ inputs.dockerfile }}
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/386
push: true
tags: ${{ inputs.tags }}
labels: |
org.opencontainers.image.created=${{ github.event.created_at }}
org.opencontainers.image.url=https://hub.docker.com/r/ckulka/baikal
org.opencontainers.image.documentation=https://github.com/ckulka/baikal-docker
org.opencontainers.image.source=https://github.com/ckulka/baikal-docker
org.opencontainers.image.version=${{ inputs.image-version }}
org.opencontainers.image.revision=${{ inputs.image-revision }}
org.opencontainers.image.licenses=MIT
org.opencontainers.image.title=Baikal
org.opencontainers.image.description=Ready-to-go Baikal server