Skip to content

Build and push image #102

Build and push image

Build and push image #102

Workflow file for this run

name: Build and push image
on:
push:
workflow_dispatch:
schedule:
- cron: 0 0 * * 1
jobs:
build-push:
concurrency:
group: ${{ github.ref }}-${{ matrix.variant }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
variant: [base, jvm, gcc, clang, rust]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: bash generate-variants.sh
- run: curl -s https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
- run: ./test.sh ${{ matrix.variant }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Log into DockerHub
run: echo "${{ secrets.DH_PAT }}" | docker login -u fwilhe2 --password-stdin
- name: Build and push (base)
if: ${{ matrix.variant == 'base' }}
run: docker buildx build --file=Dockerfile --platform=linux/amd64,linux/arm64 --push --tag=fwilhe2/act-runner:latest .
- name: Build and push (${{ matrix.variant }})
if: ${{ matrix.variant != 'base' }}
run: docker buildx build --file=Dockerfile.${{ matrix.variant }} --platform=linux/amd64,linux/arm64 --push --tag=fwilhe2/act-runner:latest-${{ matrix.variant }} .
- name: Image size (base)
if: ${{ matrix.variant == 'base' }}
run: |
docker pull fwilhe2/act-runner:latest &> /dev/null
docker inspect -f "{{ .Size }}" fwilhe2/act-runner:latest | numfmt --to iec --format "%8.4f"
- name: Image size (${{ matrix.variant }})
if: ${{ matrix.variant != 'base' }}
run: |
docker pull fwilhe2/act-runner:latest-${{ matrix.variant }} &> /dev/null
docker inspect -f "{{ .Size }}" fwilhe2/act-runner:latest-${{ matrix.variant }} | numfmt --to iec --format "%8.4f"