Update docker-build.yaml
This commit is contained in:
committed by
GitHub
parent
a050cb50ce
commit
ef6ea291d5
@@ -16,8 +16,11 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: christianlouis/document-processor
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -25,16 +28,16 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to GitHub Container Registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
@@ -44,19 +47,29 @@ jobs:
|
|||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build and Push Docker Image
|
- name: Extract metadata for tags
|
||||||
uses: docker/build-push-action@v4
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
${{ env.IMAGE_NAME }}
|
||||||
|
ghcr.io/${{ github.repository_owner }}/document-processor
|
||||||
|
|
||||||
|
- name: Build and Push Docker Image with Provenance and SBOM
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
platforms: linux/amd64
|
|
||||||
context: .
|
context: .
|
||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
|
platforms: linux/amd64
|
||||||
push: true
|
push: true
|
||||||
cache-from: type=gha
|
sbom: true
|
||||||
cache-to: type=gha,mode=max
|
provenance: mode=max
|
||||||
tags: |
|
tags: |
|
||||||
christianlouis/document-processor:latest
|
${{ env.IMAGE_NAME }}:latest
|
||||||
christianlouis/document-processor:${{ github.sha }}
|
${{ env.IMAGE_NAME }}:${{ github.sha }}
|
||||||
ghcr.io/${{ github.repository_owner }}/document-processor:latest
|
ghcr.io/${{ github.repository_owner }}/document-processor:latest
|
||||||
ghcr.io/${{ github.repository_owner }}/document-processor:${{ github.sha }}
|
ghcr.io/${{ github.repository_owner }}/document-processor:${{ github.sha }}
|
||||||
${{ startsWith(github.ref, 'refs/tags/') && format('christianlouis/document-processor:{0}', env.VERSION) || '' }}
|
${{ startsWith(github.ref, 'refs/tags/') && format('{0}:{1}', env.IMAGE_NAME, env.VERSION) || '' }}
|
||||||
${{ startsWith(github.ref, 'refs/tags/') && format('ghcr.io/{0}/document-processor:{1}', github.repository_owner, env.VERSION) || '' }}
|
${{ startsWith(github.ref, 'refs/tags/') && format('ghcr.io/{0}/document-processor:{1}', github.repository_owner, env.VERSION) || '' }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|||||||
Reference in New Issue
Block a user