diff --git a/.github/workflows/maven.yml b/.github/workflows/cicd.yml similarity index 66% rename from .github/workflows/maven.yml rename to .github/workflows/cicd.yml index 89dbf5a..363efaa 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/cicd.yml @@ -1,27 +1,31 @@ -name: Java CI with Maven +name: CI-CD on: push: - branches: [ "master" , "develop"] - pull_request: - branches: [ "master" , " develop"] + branches: [ "master" , "develop" ] jobs: build: - runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Prepare secure key manager certKey file + run: | + echo ${{ secrets.SECURE_KEY_MANAGER_CERT_KEY }} > t3team-skm-cert.txt + mkdir src/main/resources/key + base64 -d t3team-skm-cert.txt > src/main/resources/key/t3team-skm-cert.p12 + - name: Set up JDK 11 uses: actions/setup-java@v3 with: java-version: '11' distribution: 'temurin' cache: maven + - name: Build with Maven - run: mvn -B package --file pom.xml + run: mvn package ${{ secrets.MAVEN_PACKAGE_OPTIONS }} - - name : upload file + - name : delivery uses: appleboy/scp-action@master with: host: ${{ secrets.SSH_IP }} @@ -32,7 +36,7 @@ jobs: target: "~/" rm: false - - name: execute shell script + - name: deploy uses: appleboy/ssh-action@master with: host: ${{ secrets.SSH_IP }} @@ -41,6 +45,3 @@ jobs: port: ${{ secrets.SSH_PORT }} script_stop: true script: "./startup.sh" - - - name : Run SonarQube - run : mvn sonar:sonar -Dsonar.projectKey=github-action -Dsonar.host.url=${{secrets.SONAR_HOST}} -Dsonar.login=${{secrets.SONAR_TOKEN}}