Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nmaas Janitor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nmaas
nmaas Janitor
Commits
1be991a8
Commit
1be991a8
authored
1 year ago
by
Łukasz Łopatowski
Browse files
Options
Downloads
Patches
Plain Diff
Enhanced CI actions to build docker image with appropriate tag
parent
7f602a02
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.github/workflows/01-build-docker-image.yml
+16
-2
16 additions, 2 deletions
.github/workflows/01-build-docker-image.yml
with
16 additions
and
2 deletions
.github/workflows/01-build-docker-image.yml
+
16
−
2
View file @
1be991a8
name
:
Build docker image with
tag latest
name
:
Build docker image with
appropriate tag
on
:
on
:
push
:
push
:
branches
:
branches
:
-
develop
-
develop
release
:
types
:
[
released
]
jobs
:
jobs
:
build_docker_image
:
build_docker_image
:
runs-on
:
ubuntu-22.04
runs-on
:
ubuntu-22.04
steps
:
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
-
name
:
Checkout code
uses
:
actions/checkout@v4
uses
:
actions/checkout@v4
...
@@ -29,4 +43,4 @@ jobs:
...
@@ -29,4 +43,4 @@ jobs:
context
:
.
context
:
.
push
:
true
push
:
true
tags
:
|
tags
:
|
${{ secrets.DOCKER_REPOSITORY_LOCAL }}:latest
${{ secrets.DOCKER_REPOSITORY_LOCAL }}:${{ env.DOCKER_TAG }}
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment