Skip to content

fix: build-core-docker-image #2

fix: build-core-docker-image

fix: build-core-docker-image #2

# SPDX-FileCopyrightText: 2024 grow platform GmbH
#
# SPDX-License-Identifier: MIT
on:
push:
branches:
- story/4108
workflow_call:
jobs:
build-backend-docker-image:
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
IMAGE_NAME: b-s-f/yaku/api
steps:
- uses: actions/checkout@v4
- name: Restore Backend Cache
uses: actions/cache@v4
with:
path: qg-api-service
key: qg-api-service-${{ github.ref }}-${{ hashFiles('qg-api-service/**') }}
- name: Log in to the Container Registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate image tag
run: |
base_tag="${{ env.IMAGE_NAME }}:$( date '+%Y-%m-%d_%H-%M-%S' )-$(echo ${GITHUB_SHA} | cut -c1-7)"
image_tag="${{ env.REGISTRY }}/$base_tag"
echo "IMAGE_TAG=$image_tag" >> $GITHUB_ENV
- name: Build Docker Image
uses: docker/build-push-action@v5
with:
pull: true
push: true
tags: ${{ env.IMAGE_TAG }}
context: ./qg-api-service
file: qg-api-service/qg-api-service/Dockerfile
platforms: linux/amd64