Skip to content

Commit 5a5c901

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

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.github/workflows/_build_image.yml

Lines changed: 16 additions & 0 deletions
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
@@ -112,3 +115,16 @@ jobs:
112115
SOURCE_BRANCH: ${{ github.ref }}
113116
NO_PULL_IMAGE: true
114117
DOCKER_IMAGE: localhost:5000/envoy-build-${{ inputs.distro }}
118+
119+
- run: |
120+
sudo mkdir -p /mnt/cache
121+
sudo mount -t tmpfs none /mnt/cache
122+
docker save envoyproxy/envoy-build-ubuntu:${{ steps.container.outputs.tag }} \
123+
| zstd - -q -T0 -o /mnt/cache/envoy-build-ubuntu-${{ steps.container.outputs.tag }}.tar.zst
124+
if: ${{ inputs.upload_ubuntu_image }}
125+
shell: bash
126+
- uses: actions/upload-artifact@v3
127+
if: ${{ inputs.upload_ubuntu_image }}
128+
with:
129+
name: envoy-build-ubuntu
130+
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)