[Github Action] Error: Unable to locate executable file: Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.

Eunho·2023년 7월 10일
0

TroubleShooting

목록 보기
5/8

Github Action으로 Springboot 배포 자동화 하려는데 자꾸 빌드가 안 됐다 ❗

문제 1 : gradle wrapper 경로

  • gradle wrapper 디렉토리 경로를 설정해줘야 함
  • uses에 냅다 적는 게 아니라 gradle-executable로 설정해줘야 함

문제 2 : arguments : build

  • 로컬에서 빌드할 때 ./gradlew build 명령어 썼던 게 문득 생각남
    arguments : build -> run : ./gradlew build 로 바꾸고 빌드 성공!
    - name: Build with Gradle
      uses: gradle/gradle-build-action@v2
      with:
        arguments: build

    - name: Build with Gradle
      uses: gradle/gradle-build-action@v2
      with:
        gradle-executable: 'server/The_10th_Finance'
    - run: ./gradlew build
    

arguments: build는 gradle build 명령이고, run : ./gradlew build는 쉘 명령이라고 한다. 근데 이렇게 하면 안 됨

문제 3

경로 문제?

    - name: Build with Gradle and print build result
      run: |
        cd server/The_10th_Finance
        chmod +x gradlew
        ./gradlew build -x test
      shell: bash    

위치 설정하면 안 됐는데 cd해서 진행했더니 됨. 테스트 오류 있어서 제낌

여담

chatGPT보다 구글링이 더 나을 때가 있다.
별 거 아닌 일에 몇 시간 쓰는 게 가끔 현타오지만 해결한 후 쾌감이 엄청나다!

profile
🌱우당탕탕 메모장 (●'◡'●)🌱

0개의 댓글