Skip to content

Implement builds with JSON logging #5

Implement builds with JSON logging

Implement builds with JSON logging #5

Workflow file for this run

name: Create and publish a Docker image
on:
push:
branches:
- lw-0.*
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/${{ github.ref_name }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,format=long
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
file: docker/Dockerfile
build-args: |
RUST_RELEASE_MODE=release
CARGO_BUILD_FEATURES=json-log
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
cache-from: type=gha
cache-to: type=gha,mode=max