Skip to content

feat: deploy test 2

feat: deploy test 2 #2

Workflow file for this run

name: CD
on:
push:
branches: [jeongmin]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout...
uses: actions/checkout@v3
- name: Docker Login
run: docker login -u ${{ secrets.DOCKER_ID }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker
run: |
cd BE
docker build -f Dockerfile -t yaongmeow/skkuse-docker .
- name: Push Docker
run: |
cd BE
docker push yaongmeow/skkuse-docker:latest
- name: SSH Login
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
port: 22
script: |
docker login --username ${{ secrets.DOCKER_ID }} --password ${{ secrets.DOCKER_PASSWORD }}
docker pull yaongmeow/skkuse-docker
docker stop skkuse-container || true
docker rm skkuse-container || true
docker run -e DB_HOST=${{ secrets.DB_HOST }} -e DB_PORT=${{ secrets.DB_PORT }} -e DB_USER=${{ secrets.DB_USER }} -e DB_PASSWORD=${{ secrets.DB_PASSWORD }} -e DB_DATABASE=${{ secrets.DB_DATABASE }} -e JWT_SECRET_ACCESS=${{ secrets.JWT_SECRET_ACCESS }} -e JWT_SECRET_REFRESH=${{ secrets.JWT_SECRET_REFRESH }} -d -p ${{secrets.EXTERNAL_PORT}}:${{secrets.INTERNAL_PORT}} --name skkuse-container yaongmeow/skkuse-docker