-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (56 loc) · 1.82 KB
/
build-image.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
name: Build Docker Image
on:
workflow_call:
inputs:
image_path:
type: string
required: true
image_name:
type: string
required: true
image_tag:
type: string
required: true
build_args:
type: string
required: false
default: ""
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.BOT_DOCKER_USERNAME }}
password: ${{ secrets.BOT_DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ secrets.BOT_USER }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
with:
platforms: amd64,arm64
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
with:
platforms: linux/amd64,linux/arm64
- name: Build and push
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0
with:
context: ${{ inputs.image_path }}
file: ${{ inputs.image_path }}/Dockerfile
tags: |
miaplatform/${{ inputs.image_name }}:${{ inputs.image_tag }}
ghcr.io/mia-platform/${{ inputs.image_name }}:${{ inputs.image_tag }}
platforms: ${{ steps.buildx.outputs.platforms }}
build-args: |
${{ inputs.build_args }}
provenance: false
push: true