Skip to content

Commit

Permalink
chore: production deploy용 워크플로 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
kdomo committed Jan 19, 2024
1 parent 21da505 commit dc544dd
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/production_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: production Deploy

on:
workflow_dispatch:
inputs:
version:
description: 'version'
required: true

jobs:
deploy:
runs-on: ubuntu-latest
environment: PROD
steps:
- name: Deploy to NCP Server
uses: appleboy/ssh-action@master
env:
NCP_CONTAINER_REGISTRY: ${{ secrets.NCP_CONTAINER_REGISTRY }}
NCP_IMAGE_TAG: ${{ github.event.inputs.version }}
with:
host: ${{ secrets.NCP_HOST }}
username: tenminute
key: ${{ secrets.NCP_PRIVATE_KEY }}
port: ${{ secrets.NCP_PORT }}
envs: NCP_CONTAINER_REGISTRY,NCP_IMAGE_TAG # docker-compose.yml 에서 사용할 환경 변수
script: |
echo "${{ secrets.NCP_SECRET_KEY }}" | docker login -u "${{ secrets.NCP_ACCESS_KEY }}" --password-stdin "${{ secrets.NCP_CONTAINER_REGISTRY }}"
docker pull ${{ secrets.NCP_CONTAINER_REGISTRY }}/server-spring:${{ github.event.inputs.version }}
docker compose -f /home/tenminute/docker-compose.yaml up -d
docker image prune -a -f

0 comments on commit dc544dd

Please sign in to comment.