-
Notifications
You must be signed in to change notification settings - Fork 16
100 lines (87 loc) · 3.49 KB
/
publish-container-images.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Container Images
on:
workflow_call:
inputs:
ziti-version:
description: 'Ziti Tunneler Release Version'
type: string
required: true
workflow_dispatch:
inputs:
ziti-version:
description: 'Ziti Tunneler Release Version'
type: string
required: true
# no need for concurrency group in callable workflows
jobs:
publish-container-images:
runs-on: ubuntu-latest
env:
ZITI_VERSION: ${{ inputs.ziti-version || github.event.inputs.ziti-version }}
ZITI_EDGE_TUNNEL_IMAGE: ${{ vars.ZITI_EDGE_TUNNEL_IMAGE || 'docker.io/openziti/ziti-edge-tunnel' }}
ZITI_HOST_IMAGE: ${{ vars.ZITI_HOST_IMAGE || 'docker.io/openziti/ziti-host' }}
steps:
- name: Debug action
uses: hmarr/debug-action@v3
- name: Checkout Workspace
uses: actions/checkout@v4
- name: Download CMake Artifacts
uses: actions/download-artifact@v4
with:
pattern: linux-*
path: ./downloads
merge_multiple: false # some artifacts have the same name and so can not be aggregated in a single directory
- name: Unpack CMake Artifacts
shell: bash
run: |
set -x
ls -horRAS ./downloads
mkdir -p ./build/{arm64,amd64}/linux/
unzip -d ./build/arm64/linux/ ./downloads/linux-arm64/ziti-edge-tunnel-Linux_aarch64.zip
unzip -d ./build/amd64/linux/ ./downloads/linux-x64/ziti-edge-tunnel-Linux_x86_64.zip
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: amd64,arm64
- name: Set up Docker BuildKit
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_HUB_API_USER || secrets.DOCKER_HUB_API_USER }}
password: ${{ secrets.DOCKER_HUB_API_TOKEN }}
- name: Set up Docker image tags for ziti-edge-tunnel image
env:
IMAGE_REPO: ${{ env.ZITI_EDGE_TUNNEL_IMAGE }}
id: tagprep_run
run: echo DOCKER_TAGS="${IMAGE_REPO}:unstable,${IMAGE_REPO}:${ZITI_VERSION}" | tee -a $GITHUB_OUTPUT
- name: Build & Push Multi-Platform ziti-edge-tunnel Container Image
uses: docker/build-push-action@v6
with:
builder: ${{ steps.buildx.outputs.name }}
context: ${{ github.workspace }}/
file: ${{ github.workspace }}/docker/ziti-edge-tunnel.Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.tagprep_run.outputs.DOCKER_TAGS }}
build-args: |
ARTIFACTS_DIR=./build
DOCKER_BUILD_DIR=./docker
push: true
- name: Set up Docker image tags for "run-host" container
env:
IMAGE_REPO: ${{ env.ZITI_HOST_IMAGE }}
id: tagprep_run_host
run: echo DOCKER_TAGS="${IMAGE_REPO}:unstable,${IMAGE_REPO}:${ZITI_VERSION}" | tee -a $GITHUB_OUTPUT
- name: Build & Push Multi-Platform ziti-host Container Image
uses: docker/build-push-action@v6
with:
builder: ${{ steps.buildx.outputs.name }}
context: ${{ github.workspace }}/
file: ${{ github.workspace }}/docker/ziti-host.Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.tagprep_run_host.outputs.DOCKER_TAGS }}
build-args: |
ZITI_EDGE_TUNNEL_IMAGE=${{ env.ZITI_EDGE_TUNNEL_IMAGE }}
ZITI_EDGE_TUNNEL_TAG=${{ env.ZITI_VERSION }}
push: true