add spring-dotenv and gitea actions maven build pipeline
All checks were successful
Gitea Action Maven build / build (push) Successful in 29s
All checks were successful
Gitea Action Maven build / build (push) Successful in 29s
This commit is contained in:
parent
671ce3eaa0
commit
373fac5545
72
.gitea/workflows/main.yaml
Normal file
72
.gitea/workflows/main.yaml
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
name: Gitea Action Maven build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ['master']
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout the repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Set up Maven
|
||||||
|
uses: stCarolas/setup-maven@v5
|
||||||
|
with:
|
||||||
|
maven-version: 3.9.9
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: 21
|
||||||
|
distribution: 'oracle'
|
||||||
|
cache: 'maven'
|
||||||
|
- name: Build, Test and Package with Maven
|
||||||
|
run: mvn -B verify --file pom.xml -e
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: searchengine-artifact
|
||||||
|
path: |
|
||||||
|
target/*.jar
|
||||||
|
# Dockerfile
|
||||||
|
# docker-compose.yml
|
||||||
|
# - name: Create Maven settings.xml
|
||||||
|
# run: |
|
||||||
|
# cat <<EOF > ~/.m2/settings.xml
|
||||||
|
# <settings>
|
||||||
|
# <servers>
|
||||||
|
# <server>
|
||||||
|
# <id>gitea</id>
|
||||||
|
# <username>${{ vars.OWNER }}</username>
|
||||||
|
# <password>${{ secrets.ACCESS_TOKEN }}</password>
|
||||||
|
# </server>
|
||||||
|
# </servers>
|
||||||
|
# </settings>
|
||||||
|
# EOF
|
||||||
|
# - name: Replace {owner} in pom.xml
|
||||||
|
# run: sed -i "s/{owner}/${{ vars.OWNER }}/g" pom.xml
|
||||||
|
# - name: Deploy to Gitea Packages
|
||||||
|
# run: mvn deploy
|
||||||
|
# deploy:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# needs: build
|
||||||
|
# steps:
|
||||||
|
# - name: Download artifact
|
||||||
|
# uses: actions/download-artifact@v3
|
||||||
|
# with:
|
||||||
|
# name: app-artifact
|
||||||
|
# path: artifact
|
||||||
|
# - name: Install SSH Key
|
||||||
|
# uses: shimataro/ssh-key-action@v2
|
||||||
|
# with:
|
||||||
|
# key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
# known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||||
|
# - name: Deploy to Local Server
|
||||||
|
# run: scp -r artifact/* ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }}:${{ vars.DEPLOY_PATH }}
|
||||||
|
# - name: Build and Run Docker Image with Docker Compose
|
||||||
|
# run: |
|
||||||
|
# ssh -T ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }} << EOF
|
||||||
|
# cd ${{ vars.DEPLOY_PATH }}
|
||||||
|
# docker compose down
|
||||||
|
# docker compose up -d --build
|
||||||
|
# EOF
|
@ -3,9 +3,9 @@ server:
|
|||||||
|
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
username: root
|
username: ${DB_USER}
|
||||||
password: hRMH94dJ
|
password: ${DB_PASSWORD}
|
||||||
url: jdbc:mysql://localhost:3306/search_engine?useSSL=false&requireSSL=false&allowPublicKeyRetrieval=true
|
url: ${DB_URL}
|
||||||
jpa:
|
jpa:
|
||||||
hibernate:
|
hibernate:
|
||||||
ddl-auto: update
|
ddl-auto: update
|
||||||
|
9
pom.xml
9
pom.xml
@ -9,8 +9,8 @@
|
|||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>23</maven.compiler.source>
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
<maven.compiler.target>23</maven.compiler.target>
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
@ -45,5 +45,10 @@
|
|||||||
<version>8.4.0</version>
|
<version>8.4.0</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>me.paulschwarz</groupId>
|
||||||
|
<artifactId>spring-dotenv</artifactId>
|
||||||
|
<version>4.0.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
Loading…
x
Reference in New Issue
Block a user