Add latest release of actions and with a context

This commit is contained in:
Laurent Indermuehle 2023-01-20 09:53:05 +01:00
parent a849f92e2e
commit f663ee6fb9
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09

View file

@ -7,11 +7,12 @@ on:
- main
- lie_tests_using_containers
paths:
- 'test-containers/mariadb103-py38-mysqlclient201/**'
- '${{ env.CONTEXT }}/**'
env:
REGISTRY: ghcr.io
IMAGE_NAME: mariadb103-py38-mysqlclient201
IMAGE_NAME: ${{ github.actor }}/test-container-mariadb103-py38-mysqlclient201
CONTEXT: test-containers/mariadb103-py38-mysqlclient201
jobs:
@ -39,31 +40,33 @@ jobs:
# with:
# cosign-release: 'v1.11.0'
# Login against a Docker registry
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
- name: Extract Docker metadata (tags, labels)
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build and push Docker image with Buildx
# Setting up Docker Buildx with docker-container driver is required
# at the moment to be able to use a subdirectory with Git context
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# https://github.com/docker/build-push-action
- name: Build and push Docker image
- name: Build and push Docker image with Buildx
id: build-and-push
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name == 'push' }}
context: ${{ env.CONTEXT }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha