Skip to content

Build and push Docker image #2

Build and push Docker image

Build and push Docker image #2

Workflow file for this run

name: Build and push Docker image
on:
workflow_dispatch:
jobs:
build:
name: Build Docker image
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
attestations: write
packages: write
steps:
- uses: actions/checkout@v4
- name: Docker build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.docker_build.outputs.digest }}
push-to-registry: true