Skip to content

Bump docker/build-push-action from 5 to 6 #147

Bump docker/build-push-action from 5 to 6

Bump docker/build-push-action from 5 to 6 #147

Workflow file for this run

name: Container Build
on:
push:
paths:
- 'context/**'
- '.github/workflows/ci.yml'
branches:
- '**'
tags:
- '*.*.*'
env:
DOCKER_REPO: tomeichlersmith/hps-env
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
-
name: Setup QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Get Build Context
uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
-
name: Cache Docker Layers on GitHub
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-${{ hashFiles('context/Dockerfile') }}
restore-keys: |
${{ runner.os }}-${{ hashFiles('context/Dockerfile') }}
${{ runner.os }}
-
name: Determine Image Tags
id: generate_tag
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REPO }}
-
name: Determine Image labels
id: generate_labels
run: |
{
echo 'labels<<ENDOFLABELS'
echo "${{ steps.generate_tag.outputs.labels }}"
./.github/submodule-labels
echo 'ENDOFLABELS'
} >> $GITHUB_OUTPUT
-
name: Build the Image
uses: docker/build-push-action@v6
with:
context: context
file: context/Dockerfile
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: ${{ steps.generate_tag.outputs.tags }}
labels: ${{ steps.generate_labels.outputs.labels }}