feat: sync with the main branch + CredentialDefinition adoption for MT. Signed-off-by: Yurii Shynbuiev [email protected] #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Test Docker image | |
on: | |
push: | |
branches: ["main"] | |
paths: | |
- ".github/docker/**" | |
- ".github/workflows/build-test-docker.yml" | |
pull_request: | |
paths: | |
- ".github/docker/**" | |
- ".github/workflows/build-test-docker.yml" | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: agent-ci-ubuntu-22-jdk-11 | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Build Docker image | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: docker/build-push-action@v2 | |
with: | |
context: .github/docker | |
push: false | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Build and push Docker image | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
uses: docker/build-push-action@v2 | |
with: | |
context: .github/docker | |
push: true | |
tags: | | |
"ghcr.io/input-output-hk/${{ env.IMAGE_NAME }}:latest" | |
"ghcr.io/input-output-hk/${{ env.IMAGE_NAME }}:main" | |
labels: ${{ steps.meta.outputs.labels }} |