Skip to content

Merge pull request #221 from dixneuf19/feat/rye #522

Merge pull request #221 from dixneuf19/feat/rye

Merge pull request #221 from dixneuf19/feat/rye #522

name: Docker build and release
on:
push:
branches:
- "main"
tags:
- 'v*'
env:
TARGET_PLATFORMS: linux/amd64,linux/arm64
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build_and_release:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Generate automatically tags https://github.com/docker/metadata-action
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha
- 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 }}
# Build the images
- name: Build and push docker
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.TARGET_PLATFORMS }}
cache-from: type=gha
cache-to: type=gha,mode=max