Skip to content

chore(deps): update ubuntu docker tag to v22 #21

chore(deps): update ubuntu docker tag to v22

chore(deps): update ubuntu docker tag to v22 #21

name: Handle LLVM_runner docker image
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
check_changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
image_to_build: ${{ steps.set_output.outputs.image_to_build }}
steps:
- uses: actions/checkout@v4
- id: determine_changes
uses: tj-actions/changed-files@v39
with:
files_yaml: |
llvm_runner:
- "images/llvm_runner/Dockerfile"
llvm_runner_jammy:
- "images/llvm_runner/jammy.Dockerfile"
both:
- ".github/workflows/build_llvm_runner.yml"
- id: set_output
run: |
if [ "${{ steps.determine_changes.outputs.llvm_runner_any_changed }}" == "true" ]; then
echo "image_to_build=llvm_runner" >> "$GITHUB_OUTPUT"
elif [ "${{ steps.determine_changes.outputs.llvm_runner_jammy_any_changed }}" == "true" ]; then
echo "image_to_build=llvm_runner_jammy" >> "$GITHUB_OUTPUT"
elif [ "${{ steps.determine_changes.outputs.both_any_changed }}" == "true" ]; then
echo "image_to_build=both" >> "$GITHUB_OUTPUT"
else
echo "image_to_build=none" >> "$GITHUB_OUTPUT"
fi
handle_image:
needs: check_changes
if: needs.check_changes.outputs.image_to_build != 'none'
runs-on: [matterlabs-ci-runner]
strategy:
matrix:
image_name: [llvm_runner, llvm_runner_jammy]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set outputs
if: matrix.image_name == needs.check_changes.outputs.image_to_build || needs.check_changes.outputs.image_to_build == 'both'
id: set_output
run: echo "name=sha_short::$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
if: matrix.image_name == needs.check_changes.outputs.image_to_build || needs.check_changes.outputs.image_to_build == 'both'
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
if: (matrix.image_name == needs.check_changes.outputs.image_to_build || needs.check_changes.outputs.image_to_build == 'both') && github.event_name == 'push'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and optionally push Docker image
if: matrix.image_name == needs.check_changes.outputs.image_to_build || needs.check_changes.outputs.image_to_build == 'both'
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name == 'push' }}
tags: |
matterlabs/${{ matrix.image_name }}:${{ steps.set_output.outputs.sha_short }}
matterlabs/${{ matrix.image_name }}:latest
file: images/llvm_runner/${{ matrix.image_name == 'llvm_runner_jammy' && 'jammy.' || '' }}Dockerfile
platforms: linux/amd64,linux/arm64