2024-08-10 09:33:15 +00:00
|
|
|
name: Publish Docker image
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
- 'develop'
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
2024-11-23 09:00:53 +00:00
|
|
|
- 'develop'
|
2024-08-10 09:33:15 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Log in to Docker registry
|
|
|
|
uses: docker/login-action@v3.3.0
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
|
2024-11-23 09:00:53 +00:00
|
|
|
registry: ${{ var.REGISTRY }}
|
2024-08-10 09:33:15 +00:00
|
|
|
- uses: cachix/install-nix-action@v27
|
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
|
|
- name: Build Docker image
|
2024-11-23 09:00:53 +00:00
|
|
|
run: nix develop --command -- just backend build-docker
|
2024-08-10 09:33:15 +00:00
|
|
|
- name: Load Docker image
|
|
|
|
run: docker load < result
|
|
|
|
- name: Docker Metadata action
|
2024-11-23 09:00:53 +00:00
|
|
|
uses: docker/metadata-action@v5.6.1
|
2024-08-10 09:33:15 +00:00
|
|
|
with:
|
2024-11-23 09:00:53 +00:00
|
|
|
image: gejdr-backend:latest
|
|
|
|
tags:
|
|
|
|
type=ref,event=branch
|
|
|
|
type=ref,event=pr
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
type=sha
|
|
|
|
labels: |
|
|
|
|
org.opencontainers.image.title=Backend GéJDR
|
|
|
|
org.opencontainers.image.description=Backend for GéJDR
|
|
|
|
org.opencontainers.image.vendor=Lucien Cartier-Tilet <lucien@phundrak.com>
|