Skip to content

Merge pull request #181 from boostcampwm-2024/feat/client/#175 #35

Merge pull request #181 from boostcampwm-2024/feat/client/#175

Merge pull request #181 from boostcampwm-2024/feat/client/#175 #35

Workflow file for this run

name: CI/CD
on:
push:
branches:
- development
concurrency:
group: cloud-canvas
jobs:
CI:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: NCP registry login
uses: docker/login-action@v3
with:
registry: ${{ secrets.NCP_REGISTRY }}
username: ${{ secrets.NCP_ACCESS_KEY }}
password: ${{ secrets.NCP_SECRET_KEY }}
- name: Docker front image build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./apps/client/Dockerfile
push: true
tags: |
cloud-canvas.kr.ncr.ntruss.com/front:dev
cloud-canvas.kr.ncr.ntruss.com/front:${{ github.sha }}
- name: Docker front-hub image build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./apps/hub/Dockerfile
push: true
tags: |
cloud-canvas.kr.ncr.ntruss.com/front-hub:dev
cloud-canvas.kr.ncr.ntruss.com/front-hub:${{ github.sha }}
- name: Docker back image build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./apps/server/Dockerfile
push: true
tags: |
cloud-canvas.kr.ncr.ntruss.com/back:dev
cloud-canvas.kr.ncr.ntruss.com/back:${{ github.sha }}
CD:
needs: CI
runs-on: ubuntu-latest
steps:
- name: Add SSH known hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan -p ${{ secrets.NCP_DEV_INSTANCE_PORT }} ${{ secrets.NCP_DEV_INSTANCE }} >> ~/.ssh/known_hosts
- name: SSH login and deploy
run: |
printf "%s" "${{ secrets.NCP_DEV_SSH }}" > dev_login.pem
chmod 600 dev_login.pem
ssh -t -i dev_login.pem ncloud@${{ secrets.NCP_DEV_INSTANCE }} -p ${{ secrets.NCP_DEV_INSTANCE_PORT }} './docker.sh'