Skip to content

Merge branch 'release' of https://github.com/boostcampwm2023/iOS08-We… #2

Merge branch 'release' of https://github.com/boostcampwm2023/iOS08-We…

Merge branch 'release' of https://github.com/boostcampwm2023/iOS08-We… #2

name: BackEnd-CD
on:
push:
branches:
- release
jobs:
deploy:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ${{ secrets.NCP_CONTAINER_REGISTRY_PROD }}
username: ${{ secrets.NCP_ACCESS_KEY }}
password: ${{ secrets.NCP_SECRET_KEY }}
- uses: docker/build-push-action@v3
with:
context: .
file: ./BackEnd/Dockerfile
push: true
tags: ${{ secrets.NCP_CONTAINER_REGISTRY_PROD }}/my-app:latest
platforms: linux/amd64
- name: SSH to Internal Server and Deploy
run: |
sshpass -p ${{ secrets.BASTION_PASSWORD_PROD }} ssh -o StrictHostKeyChecking=no ${{ secrets.BASTION_USER_PROD }}@${{ secrets.BASTION_HOST_PROD }} -tt "
docker service update --force --image ${{ secrets.NCP_CONTAINER_REGISTRY_PROD }}/my-app:latest my-app --update-parallelism 1 --update-delay 10s
"