Skip to content

Commit b81e13c

Browse files
committed
ubuntu/image: Upload as artefact in PRs
Signed-off-by: Ryan Northey <[email protected]>
1 parent cd68397 commit b81e13c

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

.github/workflows/_build_image.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ on:
2525
test_toolchain:
2626
type: boolean
2727
default: false
28+
upload_ubuntu_image:
29+
type: boolean
30+
default: false
2831

2932
host_platform:
3033
type: string
@@ -93,10 +96,21 @@ jobs:
9396
go-version: ${{ inputs.go_version }}
9497
cache: false
9598
- uses: envoyproxy/toolshed/gh-actions/docker/[email protected]
96-
if: ${{ inputs.test_toolchain && inputs.os_family != 'windows' }}
99+
if: ${{ (inputs.test_toolchain || inputs.upload_ubuntu_image) && inputs.os_family != 'windows' }}
97100
name: 'Start and load Docker registry'
98101
with:
99102
load: envoyproxy/envoy-build-ubuntu:${{ steps.container.outputs.tag }}
103+
- run: |
104+
cd docker
105+
docker buildx build --platform linux/arm64 --push -t localhost:5000/envoyproxy/envoy-build-ubuntu:${{ steps.container.outputs.tag }}-arm64 .
106+
docker manifest create \
107+
envoyproxy/envoy-build-ubuntu:${{ steps.container.outputs.tag }}-multi \
108+
envoyproxy/envoy-build-ubuntu:${{ steps.container.outputs.tag }} \
109+
envoyproxy/envoy-build-ubuntu:${{ steps.container.outputs.tag }}-arm64
110+
111+
if: ${{ inputs.upload_ubuntu_image }}
112+
shell: bash
113+
100114
- uses: envoyproxy/toolshed/gh-actions/docker/[email protected]
101115
if: ${{ inputs.test_toolchain && inputs.os_family == 'windows' }}
102116
name: 'Start and load Docker registry (Windows)'
@@ -112,3 +126,16 @@ jobs:
112126
SOURCE_BRANCH: ${{ github.ref }}
113127
NO_PULL_IMAGE: true
114128
DOCKER_IMAGE: localhost:5000/envoy-build-${{ inputs.distro }}
129+
130+
- run: |
131+
sudo mkdir -p /mnt/cache
132+
sudo mount -t tmpfs none /mnt/cache
133+
docker save envoyproxy/envoy-build-ubuntu:${{ steps.container.outputs.tag }}-multi \
134+
| zstd - -q -T0 -o /mnt/cache/envoy-build-ubuntu-${{ steps.container.outputs.tag }}.tar.zst
135+
if: ${{ inputs.upload_ubuntu_image }}
136+
shell: bash
137+
- uses: actions/upload-artifact@v3
138+
if: ${{ inputs.upload_ubuntu_image }}
139+
with:
140+
name: envoy-build-ubuntu-${{ steps.container.outputs.tag }}
141+
path: /mnt/cache/envoy-build-ubuntu-${{ steps.container.outputs.tag }}.tar.zst

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
os_family: ${{ matrix.os_family != '' && matrix.os_family || 'linux' }}
4747
host_platform: ${{ matrix.host_platform != '' && matrix.host_platform || 'ubuntu-22.04' }}
4848
test_toolchain: ${{ github.event_name == 'pull_request' && matrix.target != 'centos' }}
49+
upload_ubuntu_image: ${{ github.event_name == 'pull_request' && matrix.target == 'ubuntu' }}
4950
secrets:
5051
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
5152
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}

0 commit comments

Comments
 (0)