From 779574d49cfb9ad7f276454ba7e6d5aad44de1b3 Mon Sep 17 00:00:00 2001 From: Muriel Paraire <72733662+MurielParaire@users.noreply.github.com> Date: Wed, 12 Jun 2024 16:15:14 +0200 Subject: [PATCH] feat(all): github workflow Signed-off-by: Muriel Paraire <72733662+MurielParaire@users.noreply.github.com> --- .github/workflows/publish.yml | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..dc6e6ff --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 }} \ No newline at end of file