File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : My Deploy
1+ name : CI for Spring Boot Microservice
22
3+ # Trigger workflow on push or pull request to main branch
34on :
4- workflow_dispatch :
5+ push :
6+ branches :
7+ - main
8+ pull_request :
9+ branches :
10+ - main
511
612jobs :
713 build :
814 runs-on : ubuntu-latest
15+
916 steps :
10- - name : Deploy to production
11- uses : johnbeynon/render-deploy-action@v0.0.8
17+ # Step 1: Checkout code
18+ - name : Checkout repository
19+ uses : actions/checkout@v3
20+
21+ # Step 2: Set up Java (match your Spring Boot version)
22+ - name : Set up Java 17
23+ uses : actions/setup-java@v3
24+ with :
25+ distribution : ' temurin'
26+ java-version : ' 17'
27+
28+ # Step 3: Cache Maven dependencies (optional, speeds up builds)
29+ - name : Cache Maven packages
30+ uses : actions/cache@v3
1231 with :
13- service-id : ${{ secrets.MY_RENDER_SERVICE_ID }}
14- api-key : ${{ secrets.MY_RENDER_API_KEY }}
15- wait-for-success : true
32+ path : ~/.m2/repository
33+ key : ${{ runner.os }}-maven-${{ hashFiles('/pom.xml') }}
34+ restore-keys : |
35+ ${{ runner.os }}-maven-
36+
37+ # Step 4: Build the Spring Boot project
38+ - name : Build with Maven
39+ run : mvn clean package -DskipTests
40+
41+ # Step 5: (Optional) Run tests
42+ - name : Run tests
43+ run : mvn test
44+
45+ # Step 6: (Optional) List the generated jar
46+ - name : List target directory
47+ run : ls -l target/
You can’t perform that action at this time.
0 commit comments