fix: common response type #25
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 CD # actions 이름 | |
on: | |
push: | |
branches: [ feature/#18 ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'adopt' | |
- name: 저장소 Checkout | |
uses: actions/checkout@v3 | |
- name: make application-prod yml file | |
run: | | |
cd ./api-module/src/main/resources | |
touch ./application-prod.yml | |
echo "${{ secrets.APPLICATION_PROD }}" > ./application-prod.yml | |
shell: bash | |
- name: make application-s3 yml file | |
run: | | |
cd ./common-module/src/main/resources | |
touch ./application-s3.yml | |
echo "${{ secrets.APPLICATION_S3 }}" > ./application-s3.yml | |
shell: bash | |
- name: make application-openapi-key yml file | |
run: | | |
cd ./api-module/src/main/resources | |
touch ./application-openapi-key.yml | |
echo "${{ secrets.APPLICATION_OPENAPI }}" > ./application-openapi-key.yml | |
shell: bash | |
- name: Gradlew 권한 부여 | |
run: chmod +x ./gradlew | |
- name: 스프링부트 애플리케이션 빌드 | |
run: ./gradlew bootJar | |
- name: 도커 이미지 빌드 | |
run: sudo docker build -t ${{ secrets.DOCKER_IMG }} --platform linux/amd64 . | |
- name: 도커 이미지 push | |
run: | | |
sudo docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
sudo docker push ${{ secrets.DOCKER_IMG }} | |
- name: scp file | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.EC2_SERVER_HOST }} | |
username: ${{ secrets.EC2_USERNAME }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
source: "docker-compose.yml" | |
target: "/home/ec2-user" | |
- name: 배포 | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.EC2_SERVER_HOST }} | |
username: ${{ secrets.EC2_USERNAME }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
port: ${{ secrets.SSH_PORT }} | |
script: | | |
touch ./docker-compose.yml | |
echo "${{ secrets.DOCKER_COMPOSE }}" > ./docker-compose.yml | |
sudo docker stop $(sudo docker ps -a -q) | |
sudo docker rm -f $(sudo docker ps -qa) | |
sudo docker pull ${{ secrets.DOCKER_IMG }} | |
sudo docker-compose -f docker-compose.yml up -d | |
sudo docker image prune -f |