# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI & CD with Maven

on:
  push:
    branches: [ master, develop ]
  pull_request:
    branches: [ master, develop ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 11
      uses: actions/setup-java@v1
      with:
        java-version: 11
    - name: Copy toolchain      
      run: |
       mkdir -p ~/.m2/
       echo "<toolchains xmlns=\"http://maven.apache.org/TOOLCHAINS/1.1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/TOOLCHAINS/1.1.0 http://maven.apache.org/xsd/toolchains-1.1.0.xsd\"><toolchain><type>jdk</type><provides><version>11</version><vendor>openjdk</vendor></provides><configuration><jdkHome>/$JAVA_HOME</jdkHome></configuration></toolchain></toolchains>" > ~/.m2/toolchains.xml
    - name: Build with Maven      
      run:
       mvn -B clean package --file pom.xml
    - name: Deploy with Maven
      run: |
       mvn release:prepare -s settings.xml
       mvn clean install
       mvn release:perform -s settings.xml

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI & CD with Maven

on:
  push:
    branches: [ master, develop ]
  pull_request:
    branches: [ master, develop ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 11
      uses: actions/setup-java@v1
      with:
        java-version: 11
    - name: Copy toolchain      
      run: |
       mkdir -p ~/.m2/
       echo "<toolchains xmlns=\"http://maven.apache.org/TOOLCHAINS/1.1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/TOOLCHAINS/1.1.0 http://maven.apache.org/xsd/toolchains-1.1.0.xsd\"><toolchain><type>jdk</type><provides><version>11</version><vendor>openjdk</vendor></provides><configuration><jdkHome>/$JAVA_HOME</jdkHome></configuration></toolchain></toolchains>" > ~/.m2/toolchains.xml
    - name: Build with Maven      
      run:
       mvn -B clean package --file pom.xml
    - name: Deploy with Maven
      run: |
       mvn deploy -s settings.xml

Replace prepare & perform with deploy
Replace prepare & perform with deploy

Signed-off-by: Kyrill Zotkin <f20a9561a40b2e4b48c4a03a58d7922eac6b458a@users.noreply.github.com >