gejdr-rs/.gitea/workflows/publish.yaml
Lucien Cartier-Tilet 578abef488
Some checks failed
CI / tests (push) Failing after 1s
CI / tests (pull_request) Failing after 2s
Publish Docker image / publish (pull_request) Failing after 1h12m17s
ci: restore publishing Docker images
2025-01-21 22:32:12 +01:00

61 lines
1.8 KiB
YAML

name: Publish Docker image
on:
push:
branches:
- 'main'
- 'develop'
tags:
- 'v*'
pull_request:
branches:
- 'main'
- 'develop'
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 }}
registry: ${{ vars.REGISTRY }}
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
sandbox = true
- name: Build Docker image
run: export HOME=/tmp/nix-home && nix build .#dockerBackend
- name: Load Docker Image
run: |
docker load < ./gejdr-backend/result
- name: Docker Metadata action
uses: docker/metadata-action@v5.6.1
id: meta
with:
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>
- name: Retag and publish Docker image for backend
env:
TAGS: ${{ steps.meta.outputs.tags }}
run: |
for tag in ${{ steps.meta.outputs.tags }}; do
newtag=${{ vars.REGISTRY }}/$tag
echo $newtag
# docker tag gejdr-backend:latest $newtag
# docker push $newtag
done