Skip to content

ci: fix docker labels (#6978) #1286

ci: fix docker labels (#6978)

ci: fix docker labels (#6978) #1286

Workflow file for this run

name: Docker
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: Docker ${{ github.ref }}
cancel-in-progress: true
env:
package-name: monica-next
jobs:
docker-run:
runs-on: ubuntu-latest
name: Docker build developpment
strategy:
fail-fast: false
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ env.package-name }}
tags: |
type=sha
labels: |
org.opencontainers.image.description="This is MonicaHQ, your personal memory! MonicaHQ is like a CRM but for the friends, family, and acquaintances around you."
org.opencontainers.image.title="MonicaHQ, the Personal Relationship Manager"
org.opencontainers.image.vendor="Monica"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PAT }}
# Configure
- name: Configure variables
run: scripts/docker/build.sh --skip-build $GITHUB_SHA
- name: Fix labels
id: labels
run: scripts/ci/labels.sh labels "${{ steps.docker_meta.outputs.labels }}"
# Build docker
- name: Docker build
id: docker_build
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ env.package-name }}:main
labels: ${{ steps.docker_meta.outputs.labels }}
file: scripts/docker/Dockerfile
context: .
platforms: linux/amd64,linux/arm64
outputs: ${{ steps.labels.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Prune images
uses: vlaurin/[email protected]
with:
token: ${{ secrets.CR_PAT }}
organization: ${{ github.repository_owner }}
container: ${{ env.package-name }}
keep-younger-than: 15
prune-untagged: true