Skip to content
Snippets Groups Projects
Unverified Commit 98761182 authored by Łukasz Łopatowski's avatar Łukasz Łopatowski Committed by GitHub
Browse files

Merge pull request #24 from nmaas-platform/23-add-ci-action-build-a-docker-image-with-release-tag

Enhanced CI actions to build docker image with appropriate tag
parents 7f602a02 1be991a8
No related branches found
No related tags found
No related merge requests found
name: Build docker image with tag latest
name: Build docker image with appropriate tag
on:
push:
branches:
- develop
release:
types: [released]
jobs:
build_docker_image:
runs-on: ubuntu-22.04
steps:
- name: Determine Docker Tag
id: docker_tag
run: |
GIT_EVENT=${{ github.event_name }}
GIT_BRANCH_NAME=${GITHUB_REF##*/}
if [[ $GIT_EVENT == 'push' && $GIT_BRANCH_NAME == 'develop' ]]; then
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
elif [[ $GIT_EVENT == 'release' ]]; then
GIT_TAG_NAME=${{ github.event.release.tag_name }}
echo "DOCKER_TAG=$(echo $GIT_TAG_NAME | cut -c 2-)" >> $GITHUB_ENV
fi
- name: Checkout code
uses: actions/checkout@v4
......@@ -29,4 +43,4 @@ jobs:
context: .
push: true
tags: |
${{ secrets.DOCKER_REPOSITORY_LOCAL }}:latest
\ No newline at end of file
${{ secrets.DOCKER_REPOSITORY_LOCAL }}:${{ env.DOCKER_TAG }}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment