diff --git a/.github/workflows/deploy-single-server.yml b/.github/workflows/deploy-single-server.yml deleted file mode 100644 index 2e4d867..0000000 --- a/.github/workflows/deploy-single-server.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Deploy to Single Server - -on: - push: - branches: - - 'main' - workflow_dispatch: - -env: - IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/cicd-edu - IMAGE_TAG: latest - CONTAINER_NAME: ${{ secrets.DOCKERHUB_USERNAME }}-cicd - PORT: 40016 # <- 변경 요망 - -jobs: - cicd: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build Container Image - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile - platforms: linux/amd64 - push: true - tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} - - - - name: SSH Remote Commands - uses: appleboy/ssh-action@v1.0.3 - with: - host: server.geunsam2.xyz - username: cicduser - password: ${{ secrets.SSH_PASSWORD }} - port: 22 - timeout: 40s - script: | - docker pull ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} - docker rm -f ${{ env.CONTAINER_NAME }} - docker run -d -p ${{ env.PORT }}:3000 --name ${{ env.CONTAINER_NAME }} ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}