fix: build-core-docker-image #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |