-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (33 loc) · 1.24 KB
/
build-project.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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:${{ env.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 }}