-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (62 loc) · 1.98 KB
/
Copy pathbuild-docker.yml
File metadata and controls
64 lines (62 loc) · 1.98 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
name: Build Docker images
on:
workflow_call:
inputs:
push:
description: "Whether to push the built images to registries"
type: boolean
default: false
jobs:
docker:
name: Docker (${{ matrix.image.name }})
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
image:
- { name: act, containerfile: container/act.containerfile }
- { name: act-build, containerfile: container/act-build.containerfile }
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
with:
path: .
pattern: "{act,act-build}-linux-*-gnu"
merge-multiple: true
- run: chmod +x act-linux-* act-build-linux-*
- uses: docker/setup-qemu-action@v4
- uses: docker/setup-buildx-action@v4
- if: ${{ inputs.push }}
uses: docker/login-action@v4
with:
registry: docker.io
username: ${{ secrets.DOCKER_IO_USERNAME }}
password: ${{ secrets.DOCKER_IO_PASSWORD }}
- if: ${{ inputs.push }}
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v6
with:
images: |
docker.io/actcore/${{ matrix.image.name }}
ghcr.io/actcore/${{ matrix.image.name }}
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
type=ref,event=pr
- uses: docker/build-push-action@v7
with:
context: .
file: ${{ matrix.image.containerfile }}
push: ${{ inputs.push }}
platforms: linux/amd64,linux/arm64,linux/riscv64
provenance: ${{ inputs.push }}
sbom: ${{ inputs.push }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}