-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (30 loc) · 945 Bytes
/
Copy pathjava-ci-cd.yml
File metadata and controls
39 lines (30 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Java CI/CD Pipeline
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '11' # Choose the appropriate Java version from your pom.xml
distribution: 'adopt' # Specify the Linux distribution (e.g., 'adopt', 'zulu')
- name: Debug
run: |
pwd
ls -l
- name: Build and Test
run: |
# Navigate to your project directory (assuming your pom.xml is there)
cd /home/runner/work/devops-githubactions/devops-githubactions/java-webapp-githubactions
# Build and test your Java application using Maven
mvn clean install
# - name: Deploy
# run: |
# echo "Deploying..."
# # Add your deployment script or commands here