-
Notifications
You must be signed in to change notification settings - Fork 418
49 lines (47 loc) · 1.23 KB
/
build-and-publish-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
name: Build and publish image
on:
workflow_call:
inputs:
tags:
required: true
type: string
platforms:
required: true
type: string
build-args:
required: true
type: string
context:
required: true
type: string
file:
required: false
type: string
default: Dockerfile
secrets:
token:
required: true
jobs:
build_push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
# Images after this version (>=v0.10) are incompatible with gcr and aws.
version: v0.9.1 # https://github.com/docker/buildx/issues/1533
- name: Login to Docker
run: docker login -u publisher -p ${{ secrets.token }} ghcr.io
- name: Docker Build
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ inputs.tags }}
platforms: ${{ inputs.platforms }}
build-args: ${{ inputs.build-args }}
context: ${{ inputs.context }}
file: ${{ inputs.context }}/${{ inputs.file }}