[BE] : 아마존 S3 , 아마존 SES 구현 #13
Workflow file for this run
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: Backend Build with Gradle | |
on: | |
push: | |
branches: [ "backend-main" ] | |
pull_request: | |
branches: [ "main", "backend-main" ] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Gradle dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('backend/**/*.gradle*', 'backend/**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Create Config | |
run: | | |
mkdir -p src/main/resources | |
mkdir -p src/test/resources | |
echo "${{ secrets.MAIN_APPLICATION_YML }}" > src/main/resources/application.yml | |
echo "${{ secrets.MAIN_APPLICATION_DEV_YML }}" > src/main/resources/application-dev.yml | |
echo "${{ secrets.MAIN_APPLICATION_PROD_YML }}" > src/main/resources/application-prod.yml | |
echo "${{ secrets.TEST_APPLICATION_YML }}" > src/test/resources/application.yml | |
echo "${{ secrets.TEST_APPLICATION_TEST_YML }}" > src/test/resources/application-test.yml | |
working-directory: backend | |
- name: Build with Gradle | |
run: ./gradlew build | |
working-directory: backend | |
- name: Setup SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Add SSH key to known hosts | |
run: | | |
mkdir -p ~/.ssh | |
ssh-keyscan ${{ secrets.BE_SERVER_IP }} >> ~/.ssh/known_hosts | |
- name: SCP transfer | |
run: scp backend/build/libs/*.jar ${{ secrets.SSH_USER }}@${{ secrets.BE_SERVER_IP }}:~/deploy |