Skip to content

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

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

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

Workflow file for this run

name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [ main ]
tags: [ '[0-9]+.[0-9]+.[0-9]+' ]
pull_request:
branches: [ main ]
env:
PUBLISH_IMAGE: ${{ startsWith(github.ref, 'refs/tags/') }}
DOCKERHUB_REPO: tenacom/buildvana-builder
TEST_TAG: tenacom/buildvana-builder:test
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout with full history
uses: actions/checkout@v4
with:
fetch-depth: 0 # Checkout with full history so nbgv can compute Git height correctly.
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Generate Docker metadata
id: meta
if: fromJSON(env.PUBLISH_IMAGE)
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKERHUB_REPO }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and load into Docker
uses: docker/build-push-action@v6
with:
context: ./docker
load: true
tags: ${{ env.TEST_TAG }}
- name: Test
run: docker run --rm -v "${{ github.workspace}}:/app" -u root ${{ env.TEST_TAG }} bash -c "(cd SampleProject && dotnet tool restore && dotnet cake --target pack)"
- name: Build and push
if: fromJSON(env.PUBLISH_IMAGE)
uses: docker/build-push-action@v6
with:
context: ./docker
push: ${{ env.PUBLISH_IMAGE }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}