Skip to content

Bump docker/build-push-action from 5.0.0 to 5.4.0 #292

Bump docker/build-push-action from 5.0.0 to 5.4.0

Bump docker/build-push-action from 5.0.0 to 5.4.0 #292

Workflow file for this run

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