Skip to content

feat: ipa 제공을 위한 index.html 서빙 코드 작성 #10

feat: ipa 제공을 위한 index.html 서빙 코드 작성

feat: ipa 제공을 위한 index.html 서빙 코드 작성 #10

Workflow file for this run

name: BackEnd-CD
on:
push:
branches:
- develop
paths:
- 'BackEnd/**'
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 }}
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 }}/my-app:latest
name: BackEnd-CD

Check failure on line 30 in .github/workflows/BackEnd_CD.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/BackEnd_CD.yml

Invalid workflow file

You have an error in your yaml syntax on line 30
on:
push:
branches:
- develop
paths:
- 'BackEnd/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ${{ secrets.NCP_CONTAINER_REGISTRY }}
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 }}/my-app:latest
- name: SSH to Internal Server and Deploy
env:
BASTION_HOST: ${{ secrets.BASTION_HOST }}
BASTION_USER: ${{ secrets.BASTION_USER }}
BASTION_PASSWORD: ${{ secrets.BASTION_PASSWORD }}
SERVER_PASSWORD: ${{ secrets.SERVER_PASSWORD }}
SERVER_USER: ${{ secrets.SERVER_USER }}
INTERNAL_SERVER_IP: ${{ secrets.INTERNAL_SERVER_IP }}
CONTAINER_REGISTRY: ${{ secrets.NCP_CONTAINER_REGISTRY }}
run: |
sshpass -p $BASTION_PASSWORD ssh -o StrictHostKeyChecking=no $BASTION_USER@$BASTION_HOST -tt << EOF
sshpass -p $SERVER_PASSWORD ssh -o StrictHostKeyChecking=no $SERVER_USER@$INTERNAL_SERVER_IP -tt << 'ENDSSH'
docker pull $CONTAINER_REGISTRY/my-app:latest
docker stop my-app || true
docker rm my-app || true
docker run --name my-app -d -p 443:3000 -p 80:3000 $CONTAINER_REGISTRY/my-app:latest
docker cp /var/env/.env my-app:/app/.env
ENDSSH
EOF