Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KPMP-5199: Add build action #14

Merged
merged 3 commits into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/build-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build atlas-file-service docker image

on:
push:

jobs:
build-project:
env:
IMAGE_TAG: 3.4
runs-on: ubuntu-latest
steps:
- name: Get branch names
id: branch-names
uses: tj-actions/branch-names@v8

- name: Get current branch name
if: steps.branch-names.outputs.is_default == 'false'
run: |
echo "Running on branch: ${{ steps.branch-names.outputs.current_branch }}"

- name: Login to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.ENV_DOCKER_USER }}
password: ${{ secrets.ENV_DOCKER_PASS }}

- name: Build and push to Docker Hub if branch is develop
if: steps.branch-names.outputs.current_branch == 'develop'
uses: docker/build-push-action@v5
with:
push: true
tags: kingstonduo/atlas-file-service:$IMAGE_TAG

- name: Build and push to Docker Hub if branch is not develop
if: steps.branch-names.outputs.current_branch != 'develop'
uses: docker/build-push-action@v5
with:
push: true
tags: kingstonduo/atlas-file-service:${{ steps.branch-names.outputs.current_branch }}
Loading