Răsfoiți Sursa

add github actions configs

Daniel Bohry 2 ani în urmă
părinte
comite
d55bb6f122

+ 18 - 0
.github/workflows/build.yml

@@ -0,0 +1,18 @@
+name: Build and Test
+
+on:
+  pull_request:
+    branches: [ main ]
+
+jobs:
+
+  build:
+
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v3
+    - name: Build jar
+      run: chmod +x ./gradlew && ./gradlew clean build
+    - name: Run tests
+      run: ./gradlew test

+ 26 - 0
.github/workflows/buildAndRelease.yml

@@ -0,0 +1,26 @@
+name: Release
+
+on:
+  push:
+    branches: [ main ]
+
+jobs:
+
+  build:
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v3
+    - name: Build jar
+      run: chmod +x ./gradlew && ./gradlew clean build
+    - name: Run tests
+      run: ./gradlew test
+    - name: Build the Docker image
+      run: docker build -t lhamacorp/auth .
+    - name: Login to Docker Hub
+      uses: docker/login-action@v2
+      with:
+        username: ${{ secrets.DOCKERHUB_USERNAME }}
+        password: ${{ secrets.DOCKERHUB_TOKEN }}
+    - name: Push image
+      run: docker push lhamacorp/auth

+ 0 - 13
src/test/java/com/danielbohry/authservice/AppTests.java

@@ -1,13 +0,0 @@
-package com.danielbohry.authservice;
-
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest
-class AppTests {
-
-    @Test
-    void contextLoads() {
-    }
-
-}