Skip to content

Commit

Permalink
created github actions workflow for docker image pushing
Browse files Browse the repository at this point in the history
  • Loading branch information
realkaranvir committed Nov 19, 2024
1 parent f5ab200 commit 098805b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Docker Image CI/CD

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
push_to_registry:
name: Push Docker Image to Docker Hub
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Check Repository
uses: actions/checkout@v4

- name: Login to Docker Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_EMAIL }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Build and Push Docker Image to Registry
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: teamfemrdev/teamfemr:latest

build:
name: Build Docker Image on Pull Request
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Check Repository
uses: actions/checkout@v4

- name: Build the Docker Image
run: docker build . --file Dockerfile --tag femr-femr:latest
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ hs_err_pid*
# except for .gitignore
!.gitignore

#except for .github/workflows
!.github

conf/application.conf
conf/application.*.conf
conf/application.example.conf
Expand Down

0 comments on commit 098805b

Please sign in to comment.