Skip to content

Change to miniChRIS-docker@next #16

Change to miniChRIS-docker@next

Change to miniChRIS-docker@next #16

Workflow file for this run

name: Build
on:
push:
branches: [ master ]
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
pull_request:
branches: [ master ]
jobs:
build:
name: Build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install rye
uses: eifinger/setup-rye@cba39b644640fb95c375ce5bfe2fdf33c0b815fc # v4.2.6
with:
version: '0.41.0'
enable-cache: true
cache-prefix: ${{ github.workflow }}
- name: Set version
run: |
if [ '${{ github.ref_type }}' = 'tag' ]; then
rye version '${{ github.ref_name }}'
else
commit='${{ github.sha }}'
rye version "0.0.0.dev1+commit.${commit:0:7}"
fi
rye version > src/serie/version.txt
- name: Build Python wheel
run: rye build --wheel --clean
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
docker.io/${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=pep440,pattern={{version}}
type=pep440,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
id: dockerhub_login
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to GitHub Container Registry
id: ghcr_login
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: ${{ steps.dockerhub_login.outcome == 'success' && steps.ghcr_login.outcome == 'success' }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Update DockerHub description
uses: peter-evans/dockerhub-description@v4
if: ${{ steps.dockerhub_login.outcome == 'success' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
short-description: ${{ github.event.repository.description }}