Skip to content

Commit

Permalink
Ajout d'un workflow GitHub pour la construction et le déploiement d'i…
Browse files Browse the repository at this point in the history
…mages Docker avec gestion des tags et authentification au registre GHCR.
  • Loading branch information
yoanbernabeu committed Dec 20, 2024
1 parent b68b502 commit f828cc9
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: ci

on:
push:
branches:
- "main"
tags:
- "*.*.*"
pull_request:
branches:
- "main"

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set Docker tags
id: meta
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "tags=ghcr.io/${{ github.repository }}:${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "tags=ghcr.io/${{ github.repository }}:dev" >> $GITHUB_OUTPUT
fi
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}

0 comments on commit f828cc9

Please sign in to comment.