Skip to content

1.1.6

1.1.6 #19

Workflow file for this run

name: Release
on:
release:
types: [released]
jobs:
release:
name: Build and publish images for release
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- context: ./backend/
image: ghcr.io/julienc91/caviardeul-backend
version-env-var: VERSION
- context: ./frontend/
image: ghcr.io/julienc91/caviardeul-frontend
version-env-var: NEXT_PUBLIC_VERSION
steps:
- uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
${{ matrix.version-env-var}}=${{ github.event.release.name }}
target: prod
clean:
name: Delete old images
needs: release
runs-on: ubuntu-latest
steps:
- uses: snok/[email protected]
with:
account: user
token: ${{ secrets.GITHUB_TOKEN }}
image-names: "caviardeul-backend caviardeul-frontend"
cut-off: 4w
keep-n-most-recent: 5