Skip to content

Commit

Permalink
feat(all): github workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Muriel Paraire <[email protected]>
  • Loading branch information
MurielParaire committed Jun 12, 2024
1 parent 8f2b1ed commit 779574d
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: build and publish the docker images

on:
push:
branches: [ "main" ]
tags:
- 'v*'

env:
REGISTRY: ghcr.io

jobs:
build-and-publish-docker-images:
runs-on: ubuntu-latest
strategy:
matrix:
image: [api, web]
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker images
uses: docker/build-push-action@v4
with:
context: ./${{ matrix.image }}
file: ./${{ matrix.image }}/dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ github.repository }}/${{ matrix.image }}:${{ github.ref_name }}

0 comments on commit 779574d

Please sign in to comment.