Bump ubuntu from focal-20240216 to focal-20240410 #283
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: main | |
push: | |
branches: main | |
permissions: | |
contents: read | |
packages: write | |
concurrency: | |
group: ci-${{github.ref}} | |
cancel-in-progress: ${{github.ref != 'refs/heads/main'}} | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Gather info | |
id: info | |
run: | | |
PACKAGE='ghcr.io/${{github.repository_owner}}/clang-format' | |
TAGS="${PACKAGE}:latest" | |
echo "##[set-output name=package;]${PACKAGE,,}" | |
echo "##[set-output name=tags;]${TAGS,,}" | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Set up docker buildx | |
id: buildx | |
uses: docker/[email protected] | |
with: | |
version: latest | |
- name: Set up cache | |
uses: actions/[email protected] | |
with: | |
path: /tmp/.buildx-cache | |
key: buildx-${{hashFiles('Dockerfile', '.dockerignore')}} | |
restore-keys: buildx- | |
- name: Build image | |
uses: docker/[email protected] | |
with: | |
builder: ${{steps.buildx.outputs.name}} | |
context: . | |
tags: ${{steps.info.outputs.tags}} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache | |
push: false | |
load: true | |
- name: Report image details | |
run: > | |
docker image history | |
--format "table {{.Size}}\t{{.CreatedBy}}" | |
${{steps.info.outputs.package}} | |
- name: Run tests | |
run: docker run ${{steps.info.outputs.package}} clang-format --version | |
- name: Login into registry | |
if: github.ref == 'refs/heads/main' | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{github.actor}} | |
password: ${{github.token}} | |
- name: Push image | |
if: github.ref == 'refs/heads/main' | |
uses: docker/[email protected] | |
with: | |
builder: ${{steps.buildx.outputs.name}} | |
context: . | |
tags: ${{steps.info.outputs.tags}} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache | |
push: true |