-
Notifications
You must be signed in to change notification settings - Fork 11
56 lines (52 loc) · 1.44 KB
/
buildkit-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
# source latest
# dest stable-1
# result docker/buildkit-syft-scanner:latest > docker/buildkit-syft-scanner:stable-1
#
# source v1.0.0
# dest stable-1
# result docker/buildkit-syft-scanner:v1.0.0 > docker/buildkit-syft-scanner:stable-1
name: buildkit-image
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
source-tag:
description: 'Source tag'
required: true
default: 'latest'
dest-tag:
description: 'Dest tag'
required: true
default: 'stable-1'
push:
required: false
type: boolean
env:
DOCKERHUB_SLUG: docker/buildkit-syft-scanner
jobs:
create:
runs-on: ubuntu-latest
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
if: ${{ inputs.push }}
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERPUBLICBOT_USERNAME }}
password: ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }}
-
name: Create
run: |
DRYRUN_FLAG=""
if [ "${{ inputs.push }}" = "false" ]; then
DRYRUN_FLAG="--dry-run"
fi
set -x
docker buildx imagetools create ${DRYRUN_FLAG} --tag \
"${{ env.DOCKERHUB_SLUG }}:${{ inputs.dest-tag }}" \
"${{ env.DOCKERHUB_SLUG }}:${{ inputs.source-tag }}"