Skip to content

Merge: RentalHistoryStatusSerializer에서 반납일, 대여일 내려주도록 수정 #38

Merge: RentalHistoryStatusSerializer에서 반납일, 대여일 내려주도록 수정

Merge: RentalHistoryStatusSerializer에서 반납일, 대여일 내려주도록 수정 #38

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