[feat] BatchScheduler 수정 #132
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: 개발 서버 CI/CD | |
on: | |
push: | |
branches: [ "develop" ] | |
permissions: | |
checks: write | |
pull-requests: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Repository 로딩 | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.VAULT_KEY }} | |
submodules: true | |
- name: Vault에 있는 설정 파일을 프로젝트로 복사 | |
run: cp ${{ secrets.PROFILE_PATH }} ./src/main/resources | |
- name: JDK 21 설치 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: gradlew 접근권한 설정 | |
run: chmod +x gradlew | |
- name: Gradle Project 테스트 | |
run: ./gradlew build -Pdevelop | |
- name: 테스트 결과 등록 | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: '**/build/test-results/test/TEST-*.xml' | |
github_token: ${{ github.token }} | |
- name: 테스트 실패 Lines 등록 | |
uses: mikepenz/action-junit-report@v3 | |
if: always() | |
with: | |
report_paths: '**/build/test-results/test/TEST-*.xml' | |
github_token: ${{ github.token }} | |
- name: SSH Agent 설정 | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.DEVELOP_SSH_KEY }} | |
- name: AWS EC2 배포 - 파일전송 | |
uses: easingthemes/[email protected] | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.DEVELOP_SSH_KEY }} | |
REMOTE_HOST: ${{ secrets.DEVELOP_HOST }} | |
REMOTE_USER: ${{ secrets.DEVELOP_USERNAME }} | |
SOURCE: 'build/libs/' | |
TARGET: '~/app/boocam' | |
EXCLUDE: '/**/*.jar' | |
# Prometheus 설정 파일 전송 | |
- name: Prometheus 설정 파일 전송 | |
uses: easingthemes/[email protected] | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.DEVELOP_SSH_KEY }} | |
REMOTE_HOST: ${{ secrets.DEVELOP_HOST }} | |
REMOTE_USER: ${{ secrets.DEVELOP_USERNAME }} | |
SOURCE: 'src/main/resources/prometheus.yml' | |
TARGET: '/tmp' | |
- name: jar 파일 실행 | |
run: | | |
ssh -o StrictHostKeyChecking=no ${{ secrets.DEVELOP_USERNAME }}@${{ secrets.DEVELOP_HOST }} << EOF | |
sudo mv /tmp/prometheus.yml /etc/prometheus/prometheus.yml | |
pkill -f 'FastTime-0.0.1-SNAPSHOT.jar' || true | |
cd ~/app/boocam | |
nohup java -jar -Dspring.profiles.active=develop FastTime-0.0.1-SNAPSHOT.jar > app.log 2>&1 & | |
sudo systemctl restart prometheus | |
EOF | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.DEVELOP_SSH_KEY }} |