Skip to content

Dockerfile: optimize layers #110

Dockerfile: optimize layers

Dockerfile: optimize layers #110

Workflow file for this run

---
name: Publish Docker Image
on: push
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
name: Build and publish Docker image πŸ“¦ to ghcr πŸ—ƒοΈ
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository πŸ›’
uses: actions/checkout@v4
- name: Update version in pyproject.toml ⬆️
uses: brettdorrans/[email protected]
with:
filename: 'pyproject.toml'
placeholder: '1.0.0.dev1'
- name: Set up QEMU πŸ‘·
uses: docker/setup-qemu-action@v3
- 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.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker πŸ—‚οΈ
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image πŸ“¦ to ghcr πŸ—ƒοΈ
uses: docker/build-push-action@v6
with:
context: .
push: ${{ startsWith(github.ref, 'refs/tags/') }} # only upload to ghcr on tag pushes
provenance: false
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}