From c3914ce795aa8621463cc591a7977a40ab326770 Mon Sep 17 00:00:00 2001 From: Karthick_Sha <102850284+Karthick-SK1@users.noreply.github.com> Date: Tue, 14 Nov 2023 15:39:37 +0530 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..7f7ae5e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,45 @@ +name: Build and Deploy + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' + + - name: Build with Maven + run: mvn clean install + + deploy: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' + + - name: Deploy to GitHub Pages + run: | + rm -rf docs + mkdir docs + cp target/Springboot-0.0.1-SNAPSHOT.jar docs/ + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}