feat: 액세스 토큰이 null인 경우 처리 #58
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: Deploy to EC2 | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'develop' | |
- 'deploy/**' | |
jobs: | |
deploy: | |
name: Deployment | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Create application.yml file | |
run: | | |
mkdir src/main/resources | |
touch ./src/main/resources/application.yml | |
echo "${{ secrets.APPLICATION }}" > ./src/main/resources/application.yml | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Caching Gradle | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Build with Gradle | |
run: | | |
chmod +x gradlew | |
./gradlew bootJar | |
- name: Copy files to server | |
uses: appleboy/scp-action@v0.1.4 | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
port: ${{ secrets.PORT }} | |
overwrite: true | |
source: "docker/*.prod.yml,config/nginx/nginx.conf,build/libs/*.jar" | |
target: ${{ secrets.FILE_PATH }} | |
- name: Executing remote ssh commands to run docker | |
uses: appleboy/ssh-action@v1.0.0 | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
port: ${{ secrets.PORT }} | |
script: | | |
cd app/docker | |
sudo docker rm -f $(sudo docker ps -qa) | |
sudo docker compose -f docker-compose.prod.yml up -d --build | |
sudo docker image prune -f |