Skip to content

Commit

Permalink
chore: github action test
Browse files Browse the repository at this point in the history
  • Loading branch information
DWL21 committed Feb 14, 2025
1 parent 7835019 commit 65a8441
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/cd-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Dev - CI/CD without Tests

on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]

jobs:
build-and-deploy:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./

steps:
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle

- name: Deploy to EC2
env:
PRIVATE_KEY: ${{ secrets.YOURSSU_SECRET}}
HOST: ${{ secrets.YOURSSU_STG_HOST }}
run: |
mkdir -p ~/.ssh
ssh-keyscan -H $HOST >> ~/.ssh/known_hosts
echo "$PRIVATE_KEY" > private_key.pem
chmod 600 private_key.pem
mv build/libs/soongpt-0.0.1-SNAPSHOT.jar yourssu-soongpt-application.jar
scp -i private_key.pem yourssu-soongpt-application.jar ubuntu@$HOST:/home/ubuntu/soongpt-api
ssh -i private_key.pem ubuntu@$HOST "/home/ubuntu/soongpt-api/run.sh"

0 comments on commit 65a8441

Please sign in to comment.