Skip to content

Commit

Permalink
ubuntu/image: Upload as artefact in PRs
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <[email protected]>
  • Loading branch information
phlax committed Sep 13, 2023
1 parent cd68397 commit b81e13c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/_build_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ on:
test_toolchain:
type: boolean
default: false
upload_ubuntu_image:
type: boolean
default: false

host_platform:
type: string
Expand Down Expand Up @@ -93,10 +96,21 @@ jobs:
go-version: ${{ inputs.go_version }}
cache: false
- uses: envoyproxy/toolshed/gh-actions/docker/[email protected]
if: ${{ inputs.test_toolchain && inputs.os_family != 'windows' }}
if: ${{ (inputs.test_toolchain || inputs.upload_ubuntu_image) && inputs.os_family != 'windows' }}
name: 'Start and load Docker registry'
with:
load: envoyproxy/envoy-build-ubuntu:${{ steps.container.outputs.tag }}
- run: |
cd docker
docker buildx build --platform linux/arm64 --push -t localhost:5000/envoyproxy/envoy-build-ubuntu:${{ steps.container.outputs.tag }}-arm64 .
docker manifest create \
envoyproxy/envoy-build-ubuntu:${{ steps.container.outputs.tag }}-multi \
envoyproxy/envoy-build-ubuntu:${{ steps.container.outputs.tag }} \
envoyproxy/envoy-build-ubuntu:${{ steps.container.outputs.tag }}-arm64
if: ${{ inputs.upload_ubuntu_image }}
shell: bash
- uses: envoyproxy/toolshed/gh-actions/docker/[email protected]
if: ${{ inputs.test_toolchain && inputs.os_family == 'windows' }}
name: 'Start and load Docker registry (Windows)'
Expand All @@ -112,3 +126,16 @@ jobs:
SOURCE_BRANCH: ${{ github.ref }}
NO_PULL_IMAGE: true
DOCKER_IMAGE: localhost:5000/envoy-build-${{ inputs.distro }}
- run: |
sudo mkdir -p /mnt/cache
sudo mount -t tmpfs none /mnt/cache
docker save envoyproxy/envoy-build-ubuntu:${{ steps.container.outputs.tag }}-multi \
| zstd - -q -T0 -o /mnt/cache/envoy-build-ubuntu-${{ steps.container.outputs.tag }}.tar.zst
if: ${{ inputs.upload_ubuntu_image }}
shell: bash
- uses: actions/upload-artifact@v3
if: ${{ inputs.upload_ubuntu_image }}
with:
name: envoy-build-ubuntu-${{ steps.container.outputs.tag }}
path: /mnt/cache/envoy-build-ubuntu-${{ steps.container.outputs.tag }}.tar.zst
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
os_family: ${{ matrix.os_family != '' && matrix.os_family || 'linux' }}
host_platform: ${{ matrix.host_platform != '' && matrix.host_platform || 'ubuntu-22.04' }}
test_toolchain: ${{ github.event_name == 'pull_request' && matrix.target != 'centos' }}
upload_ubuntu_image: ${{ github.event_name == 'pull_request' && matrix.target == 'ubuntu' }}
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
Expand Down

0 comments on commit b81e13c

Please sign in to comment.