Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

배포 자동화 수정 #45

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/BE-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
run: |
git clone https://github.com/boostcampwm2023/and07-MindSync.git mindsync
cd mindSync/nestjs-BE
- uses: actions/checkout@v4
with:
sparse-checkout: nestjs-BE
- name: Login to github Packages
run: echo ${{ secrets.PACKAGE_ACCESS_TOKEN }} | docker login ghcr.io -u ${{ secrets.PACKAGE_USERNAME }} --password-stdin
- name: Build and push Docker image
run: |
docker build -t ghcr.io/${{ secrets.PACKGE_USERNAME }}/mindsync .
docker build -t ghcr.io/${{ secrets.PACKGE_USERNAME }}/mindsync ./nestjs-BE
docker push ghcr.io/${{ secrets.PACKAGE_USERNAME }}/mindsync:latest

deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Pull Docker image
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
port: ${{ secrets.REMOTE_PORT }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.REMOTE_SSH_KEY }}
script: |
Expand Down