[FEATURE] : JWT 토큰 생성 및 검증 #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java CI/CD with Gradle | |
on: | |
pull_request: | |
branches: | |
- 'develop' | |
- 'main' | |
push: | |
branches: | |
- 'develop' | |
- 'main' | |
jobs: | |
ci-pipeline: | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: '21' | |
- name: Grant execute permission for Gradle Wrapper | |
run: chmod +x ./gradlew | |
- name: Lint and format code | |
run: ./gradlew editorconfigFormat | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Test with Gradle | |
run: ./gradlew test | |
cd-pipeline: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/develop' | |
runs-on: ubuntu-latest | |
steps: | |
- name: SSH로 NCP 접속하기 | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.NCP_HOST }} | |
username: ${{ secrets.NCP_USERNAME }} | |
password: ${{ secrets.NCP_SSH_PASSWORD }} | |
port: ${{ secrets.NCP_SSH_PORT }} | |
script_stop: true | |
script: | | |
cd auction | |
git pull origin develop | |
chmod 777 ./gradlew | |
./gradlew editorconfigFormat | |
./gradlew build | |
kill -9 $(lsof -t -i:8080) || echo "No process on 8080" | |
nohup java -jar build/libs/*SNAPSHOT.jar > ./output.log 2>&1 & |