Skip to content

Commit 2dbe4e3

Browse files
Update maven.yml
1 parent c8fb20f commit 2dbe4e3

1 file changed

Lines changed: 3 additions & 59 deletions

File tree

.github/workflows/maven.yml

Lines changed: 3 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,11 @@
1-
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3-
4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
8-
9-
name: Java CI with Maven
1+
name: Maven Build CI/CD Pipeline
102

113
on:
124
push:
13-
branches: [ "master" ]
5+
branches: [ "master", "develop" ]
146
pull_request:
157
branches: [ "master" ]
16-
workflow_dispatch:
178

18-
env:
19-
mavenGoal: "clean install"
209
jobs:
2110
build:
22-
runs-on: ubuntu-latest
23-
env:
24-
buildScript: "pom.xml"
25-
steps:
26-
- uses: actions/checkout@v3
27-
- name: Set up JDK 17
28-
uses: actions/setup-java@v3
29-
with:
30-
java-version: '17'
31-
distribution: 'temurin'
32-
cache: maven
33-
- name: Build with Maven
34-
run: "mvn -B ${mavenGoal} --file ${buildScript}"
35-
- name: SonarQube Scan
36-
uses: sonarsource/sonarqube-scan-action@master
37-
env:
38-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
39-
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
40-
- uses: actions/upload-artifact@v3
41-
with:
42-
name: buildArtifact
43-
path: target/*.war
44-
45-
deploy:
46-
needs: build
47-
runs-on: ubuntu-latest
48-
steps:
49-
- uses: actions/download-artifact@v3
50-
with:
51-
name: buildArtifact
52-
- name: Production Deployment
53-
run: |
54-
ls -lart
55-
- name: scp ssh pipelines
56-
uses: cross-the-world/ssh-scp-ssh-pipelines@latest
57-
env:
58-
LASTSSH: "Doing something after copying"
59-
with:
60-
host: ${{ secrets.DC_HOST }}
61-
user: ${{ secrets.DC_USER }}
62-
pass: ${{ secrets.DC_KEY }}
63-
scp: |
64-
./*.war => /tmp/
65-
last_ssh: |
66-
sudo cp /tmp/*.war /var/lib/tomcat9/webapps/Anuj.war
67-
ls -la
11+
uses: anujdevopslearn/GithubActionsWorkflows/.github/workflows/maven.yml@main

0 commit comments

Comments
 (0)