Skip to content

feat : docker를 이용한 자동 배포 설정 #35 #2

feat : docker를 이용한 자동 배포 설정 #35

feat : docker를 이용한 자동 배포 설정 #35 #2

Workflow file for this run

name: auto deploy
on:
push:
branches:
- dev
jobs:
push_to_registry:
name: Push to ncp container registry
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to NCP Container Registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.NCP_CONTAINER_REGISTRY }}
username: ${{ secrets.NCP_ACCESS_KEY }}
password: ${{ secrets.NCP_SECRET_KEY }}
- name: build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.NCP_CONTAINER_REGISTRY }}/nibobnebob:latest
cache-from: type=registry,ref=${{ secrets.NCP_CONTAINER_REGISTRY }}/nibobnebob:latest

Check failure on line 30 in .github/workflows/be-autodeploy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/be-autodeploy.yml

Invalid workflow file

You have an error in your yaml syntax on line 30
cache-to: type=inline
pull_from_registry:
name: Connect server ssh and pull from container registry
needs: push_to_registry
runs-on: ubuntu-latest
steps:
- name: connect ssh
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEV_HOST }}
username: ${{ secrets.DEV_USERNAME }}
password: ${{ secrets.DEV_PASSWORD }}
port: ${{ secrets.DEV_PORT }}
script: |
docker pull ${{ secrets.NCP_CONTAINER_REGISTRY }}/nibobnebob
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker run -d -p 8000:80 ${{ secrets.NCP_CONTAINER_REGISTRY }}/nibobnebob
docker image prune -f