Skip to content

Update docker/metadata-action action to v5 #62

Update docker/metadata-action action to v5

Update docker/metadata-action action to v5 #62

Workflow file for this run

name: 'Build Docker image'
on:
push:
branches:
- main
tags:
- v*
pull_request:
paths:
- 'src/**'
- Cargo.toml
- Cargo.lock
- Dockerfile
- .github/workflows/build_image.yml
jobs:
build:
runs-on: ubuntu-20.04
env:
CONTAINER_REGISTRY: ghcr.io
steps:
- uses: actions/checkout@v3
- name: Set up Buildx
uses: docker/setup-buildx-action@v2
- name: Docker metadata
id: metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.CONTAINER_REGISTRY }}/${{ github.repository }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.CONTAINER_REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
push: false
# push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max