From 0a239dca35577f604ce621906ef7ba02c46b7e4f Mon Sep 17 00:00:00 2001 From: edwinchofong86 <67196148+edwinchofong86@users.noreply.github.com> Date: Mon, 8 May 2023 09:49:58 -0400 Subject: [PATCH 1/5] Create maven-publish.yml --- .github/workflows/maven-publish.yml | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/maven-publish.yml diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml new file mode 100644 index 0000000000..dab69fef79 --- /dev/null +++ b/.github/workflows/maven-publish.yml @@ -0,0 +1,34 @@ +# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path + +name: Maven Package + +on: + release: + types: [created] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Build with Maven + run: mvn -B package --file pom.xml + + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml + env: + GITHUB_TOKEN: ${{ github.token }} From 66e89729294b8f800e900658ad6a51c85d2d5ead Mon Sep 17 00:00:00 2001 From: edwinchofong86 <67196148+edwinchofong86@users.noreply.github.com> Date: Mon, 8 May 2023 10:10:38 -0400 Subject: [PATCH 2/5] Update maven-publish.yml added trigger --- .github/workflows/maven-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index dab69fef79..41cb6892b8 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -5,7 +5,7 @@ name: Maven Package on: release: - types: [created] + types: push jobs: build: From 8b071aa3583f3ddf838831373f9ca371171bf166 Mon Sep 17 00:00:00 2001 From: edwinchofong86 <67196148+edwinchofong86@users.noreply.github.com> Date: Mon, 8 May 2023 11:48:53 -0400 Subject: [PATCH 3/5] Update home.jsp --- src/main/webapp/jsps/home.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/jsps/home.jsp b/src/main/webapp/jsps/home.jsp index 8a19925368..f376d996f9 100644 --- a/src/main/webapp/jsps/home.jsp +++ b/src/main/webapp/jsps/home.jsp @@ -10,7 +10,7 @@

Landmark Technologies

-

Welcome to Landmark Technology. +

Welcome to Landmark Technology class of 2022. Landmark Technology is a an ideal online training platform for DevOps and Cloud Engineers. We offer interview preparations and job assitance. The shout of the King is in our midst. His name is JESUS. HE IS OUR SUCCESS ACCESS KEY

From cc11323cca6cc2f3d6b47c003f68d92c29eef81e Mon Sep 17 00:00:00 2001 From: edwinchofong86 <67196148+edwinchofong86@users.noreply.github.com> Date: Mon, 8 May 2023 12:07:47 -0400 Subject: [PATCH 4/5] Update maven-publish.yml set branch protection rule --- .github/workflows/maven-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 41cb6892b8..280182a824 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -4,8 +4,8 @@ name: Maven Package on: - release: - types: push + branch_protection_rule: + types: [created, deleted, edited] jobs: build: From d6e722523014c07d66715b54829345365dc3ea9b Mon Sep 17 00:00:00 2001 From: edwinchofong86 <67196148+edwinchofong86@users.noreply.github.com> Date: Mon, 8 May 2023 13:01:17 -0400 Subject: [PATCH 5/5] Update maven-publish.yml changed maven-publish.yml --- .github/workflows/maven-publish.yml | 66 ++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 21 deletions(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 280182a824..69f2aa77f0 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -1,34 +1,58 @@ -# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created -# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path - -name: Maven Package +name: Maven CI/CD Pipeline on: - branch_protection_rule: - types: [created, deleted, edited] + push: + branches: + - main + pull_request: + branches: + - main jobs: build: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - name: Set up JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v2 with: + distribution: 'adopt' java-version: '11' - distribution: 'temurin' - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - name: Build with Maven - run: mvn -B package --file pom.xml + - name: Cache Maven dependencies + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Build and test + run: mvn clean verify --batch-mode --update-snapshots + + deploy: + needs: build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' + - name: Cache Maven dependencies + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Build + run: mvn clean package -DskipTests + - name: Deploy to your server + run: | + # Add your deployment commands here - - name: Publish to GitHub Packages Apache Maven - run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml - env: - GITHUB_TOKEN: ${{ github.token }}