Skip to content

Merge: 네이버, 구글, 카카오 소셜 로그인 완성 및 리팩토링 #24

Merge: 네이버, 구글, 카카오 소셜 로그인 완성 및 리팩토링

Merge: 네이버, 구글, 카카오 소셜 로그인 완성 및 리팩토링 #24

Workflow file for this run

name: docker cicd
on:
push:
branches: [ "develop" ]
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_IMAGE: ${{ secrets.DOCKER_IMAGE }}
jobs:
build:
name: docker build
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: docker login
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: build the docker image
run: |
docker build -t $DOCKER_USER/$DOCKER_IMAGE:latest .
- name: docker push
run: |
docker push $DOCKER_USER/$DOCKER_IMAGE:latest
deploy:
name: deploy to EC2
needs: build
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: |
docker pull ${{ secrets.DOCKER_USER }}/${{ secrets.DOCKER_IMAGE }}:latest
docker rm -f ${{ secrets.BE_CONTAINER }}
docker run -d -p ${{ secrets.BE_PORT }}:${{ secrets.BE_PORT }} --name ${{ secrets.BE_CONTAINER }} --network ${{ secrets.BE_NETWORK }} -v ${{ secrets.BE_VOLUME }} ${{ secrets.DOCKER_USER }}/${{ secrets.DOCKER_IMAGE }}:latest