Skip to content

Commit 86def3a

Browse files
committed
Merge branch 'main' of github.com:portainer/dev-toolkit
2 parents 3295736 + c22f7bf commit 86def3a

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

.github/workflows/dev-toolkit.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: "dev-toolkit"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_tag:
7+
description: "release tag e.g. 2025.01"
8+
required: true
9+
push:
10+
tags:
11+
- '*'
12+
13+
env:
14+
DOCKER_HUB_REPO: portainer/dev-toolkit
15+
IMAGE_TAG: ${{ github.event_name == 'push' && github.ref_name || inputs.release_tag }}
16+
17+
jobs:
18+
build_images:
19+
strategy:
20+
matrix:
21+
config:
22+
- { platform: linux, arch: amd64 }
23+
- { platform: linux, arch: arm64 }
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: "[preparation] checkout"
27+
uses: actions/[email protected]
28+
29+
- name: "[preparation] set up qemu"
30+
uses: docker/[email protected]
31+
32+
- name: "[preparation] set up docker context for buildx"
33+
run: docker context create builders
34+
35+
- name: "[preparation] set up docker buildx"
36+
uses: docker/[email protected]
37+
with:
38+
endpoint: builders
39+
driver-opts: image=moby/buildkit:v0.20.0
40+
41+
- name: "[preparation] docker login"
42+
uses: docker/[email protected]
43+
with:
44+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
45+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
46+
47+
- name: "build and push image"
48+
uses: docker/[email protected]
49+
with:
50+
platforms: ${{ matrix.config.platform }}/${{ matrix.config.arch }}
51+
tags: ${{ env.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }}-${{ matrix.config.platform }}-${{ matrix.config.arch }}
52+
sbom: false
53+
provenance: false
54+
push: true
55+
cache-from: type=gha
56+
cache-to: type=gha,mode=max
57+
outputs: type=registry
58+
59+
build_manifests:
60+
needs: [build_images]
61+
runs-on: ubuntu-latest
62+
steps:
63+
- name: "[preparation] docker login"
64+
uses: docker/[email protected]
65+
with:
66+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
67+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
68+
69+
- name: "create and push multi-arch manifest"
70+
run: |
71+
docker manifest create \
72+
${{ env.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }} \
73+
${{ env.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }}-linux-amd64 \
74+
${{ env.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }}-linux-arm64
75+
docker manifest push ${{ env.DOCKER_HUB_REPO }}:${{ env.IMAGE_TAG }}

0 commit comments

Comments
 (0)