Skip to content

Commit

Permalink
feat: #14 - CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
2522001 authored May 21, 2024
2 parents 5a27565 + 1c907c5 commit 28ded0c
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: issue-tracking-system CI/CD

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

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'

- name: Set up environment variables
run: |
echo "DB_URL=${{ secrets.DB_URL }}" >> $GITHUB_ENV
echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" >> $GITHUB_ENV
echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> $GITHUB_ENV
- name: Build with Gradle
run: ./gradlew build

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Docker image
run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/issue-tracking-system:latest .

- name: Push Docker image
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/issue-tracking-system:latest
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM openjdk:17-jdk

ARG JAR_FILE=build/libs/*.jar

COPY ${JAR_FILE} app.jar

ENTRYPOINT ["java", "-jar", "app.jar"]

0 comments on commit 28ded0c

Please sign in to comment.