Skip to content

Commit

Permalink
ci(github): publish docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil committed Jan 5, 2024
1 parent e079018 commit 89ebb9d
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#

name: Publish

on:
push:
branches:
- main
- alpha

workflow_dispatch:

permissions:
packages: write

jobs:
build:
name: Publich Docker Image
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/betagouv/espace-partenaire
tags: |
type=sha,format=long,prefix=
type=ref,event=branch
type=ref,event=tag
flavor: |
latest=${{ github.ref == 'refs/heads/main' }}
- name: Build image
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max
build-args: |
SOURCE_COMMIT=${{ github.sha }}

0 comments on commit 89ebb9d

Please sign in to comment.