Skip to content

Initial commit: bilingual FR/EN engineering blog #1

Initial commit: bilingual FR/EN engineering blog

Initial commit: bilingual FR/EN engineering blog #1

Workflow file for this run

name: Build & Push Image
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
name: Build and publish container image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,prefix=sha-,format=short
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
# TODO: brancher l'étape pull/run sur l'infra Linagora.
# Exemples possibles :
# - SSH sur la VM cible et `docker compose pull && docker compose up -d`
# - Mise à jour d'un Deployment Kubernetes via kubectl
# - Webhook vers un orchestrateur interne