✨ feat: v1 플레임 그래프 완료 (#56) #23
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: auto deploy | |
on: | |
push: | |
branches: | |
- feature/56-v1-profile | |
jobs: | |
push_to_registry: | |
name: Push to ncp container registry | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to NCP Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ secrets.NCP_CONTAINER_REGISTRY }} | |
username: ${{ secrets.NCP_ACCESS_KEY }} | |
password: ${{ secrets.NCP_SECRET_KEY }} | |
- name: build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ${{ secrets.NCP_CONTAINER_REGISTRY }}/backend:latest | |
cache-from: type=registry,ref=${{ secrets.NCP_CONTAINER_REGISTRY }}/prv-backend:latest | |
cache-to: type=inline | |
secrets: | | |
GIT_AUTH_TOKEN=${{ secrets.GIT_TOKEN }} | |
- name: Build and push backend-flame | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: ./Dockerfile.clinic-flame | |
push: true | |
tags: ${{ secrets.NCP_CONTAINER_REGISTRY }}/backend-flame:latest | |
cache-from: type=registry,ref=${{ secrets.NCP_CONTAINER_REGISTRY }}/prv-backend-flame:latest | |
cache-to: type=inline | |
secrets: | | |
GIT_AUTH_TOKEN=${{ secrets.GIT_TOKEN }} | |
pull_from_registry: | |
name: Connect server ssh and pull from container registry | |
needs: push_to_registry | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Copy docker-compose file to server | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.DEV_HOST }} | |
username: ${{ secrets.DEV_USERNAME }} | |
password: ${{ secrets.DEV_PASSWORD }} | |
port: ${{ secrets.DEV_PORT }} | |
source: "docker-compose.yml" | |
target: "~/" | |
- name: connect ssh | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.DEV_HOST }} | |
username: ${{ secrets.DEV_USERNAME }} | |
password: ${{ secrets.DEV_PASSWORD }} | |
port: ${{ secrets.DEV_PORT }} | |
script: | | |
echo "DB_TYPE=${{ secrets.DB_TYPE }}" > .env | |
echo "DB_HOST=${{ secrets.DB_HOST }}" >> .env | |
echo "DB_PORT=${{ secrets.DB_PORT }}" >> .env | |
echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" >> .env | |
echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env | |
echo "DB_DATABASE=${{ secrets.DB_DATABASE }}" >> .env | |
echo "DB_SYNCHRONIZE=${{ secrets.DB_SYNCHRONIZE }}" >> .env | |
echo "JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY }}" >> .env | |
echo "MAIL_HOST=${{ secrets.MAIL_HOST }}" >> .env | |
echo "MAIL_PORT=${{ secrets.MAIL_PORT }}" >> .env | |
echo "MAIL_USER=${{ secrets.MAIL_USER }}" >> .env | |
echo "MAIL_PWD=${{ secrets.MAIL_PWD }}" >> .env | |
echo "API_BASE_URL=${{ secrets.API_BASE_URL }}" >> .env | |
echo "SERVER_PORT=${{ secrets.SERVER_PORT }}" >> .env | |
echo "NCP_CONTAINER_REGISTRY=${{ secrets.NCP_CONTAINER_REGISTRY }}" >> .env | |
echo "BACKEND_OUTBOUND_PORT=${{ secrets.BACKEND_OUTBOUND_PORT }}" >> .env | |
echo "BACKEND_INBOUND_PORT=${{ secrets.BACKEND_INBOUND_PORT }}" >> .env | |
echo "MYSQL_OUTBOUND_PORT=${{ secrets.MYSQL_OUTBOUND_PORT }}" >> .env | |
echo "MYSQL_INBOUND_PORT=${{ secrets.MYSQL_INBOUND_PORT }}" >> .env | |
echo "MYSQL_ROOT_PASSWORD=${{ secrets.MYSQL_ROOT_PASSWORD }}" >> .env | |
echo "JWT_ACCESS_TOKEN_EXPIRATION=${{ secrets.JWT_ACCESS_TOKEN_EXPIRATION }}" >> .env | |
echo "JWT_REFRESH_TOKEN_EXPIRATION=${{ secrets.JWT_REFRESH_TOKEN_EXPIRATION }}" >> .env | |
docker-compose down | |
docker pull ${{ secrets.NCP_CONTAINER_REGISTRY }}/backend:latest | |
docker pull ${{ secrets.NCP_CONTAINER_REGISTRY }}/backend-flame:latest | |
docker-compose up -d backend mysql-prod | |
docker image prune -f | |