Skip to content

Create maven.yml

Create maven.yml #1

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: JAVA CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# jdk 11 세팅
- 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
# 쉘 스크립트 실행
- name: execute shell script
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_IP }}
username: ${{ secrets.SSH_ID }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script_stop: true
script: "./startup.sh"
# SonarQube 실행
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONARQUBE_SERVER_URL }}
with:
args: >

Check failure on line 54 in .github/workflows/maven.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/maven.yml

Invalid workflow file

You have an error in your yaml syntax on line 54
-Dsonar.projectKey=${{ secrets.SONARQUBE_PROJECT_KEY }}
-Dsonar.sources=.
-Dsonar.exclusions=**/*.html
-Dsonar.java.binaries=target/classes
# 업로드 실행
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: my-artifact
path: target/*.jar