Skip to content

feat: db exports for developpers #504

feat: db exports for developpers

feat: db exports for developpers #504

name: Docker Image CI
on:
push:
branches:
- 'main'
pull_request:
permissions:
packages: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: v0.10.0
buildkitd-flags: --debug
- name: Install poetry
run: pipx install poetry
- name: Use Python
uses: actions/setup-python@v6
with:
python-version: 3.11
cache: 'poetry'
- name: Install Dependencies
run: make install
- name: Run Tests
run: make tests
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
tags: |
type=semver,pattern={{version}}
type=ref,event=pr
type=ref,event=branch
type=sha,format=long
- name: Build and Push (Non-PR Events)
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v6
with:
context: .
push: true
file: Dockerfile
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:buildcache,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build Only (PR from Forks)
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
uses: docker/build-push-action@v6
with:
context: .
push: false
file: Dockerfile
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:buildcache
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build and Push (PR from Same Repo)
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: docker/build-push-action@v6
with:
context: .
push: true
file: Dockerfile
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:buildcache,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}