From 9ed965519a7ee0418ac498966e2e21d48072031d Mon Sep 17 00:00:00 2001 From: Nourman Hajar Date: Sun, 15 Dec 2024 22:54:24 +0700 Subject: [PATCH] fix: workflow remove deploy step --- .github/workflows/build-deploy.yml | 36 ------------------------------ 1 file changed, 36 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index b161500..50f0daa 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -44,39 +44,3 @@ jobs: - name: Build and push container image run: pnpm nx container ${{ env.IMAGE_NAME }} - - deploy: - runs-on: ubuntu-latest - needs: build_and_push - environment: - name: ${{ github.event.inputs.image-name }}-production - url: https://ziyo.nourman.com - steps: - - name: Deploy to Droplet - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.SSH_HOST }} - username: ${{ secrets.SSH_USERNAME }} - key: ${{ secrets.SSH_KEY }} - envs: IMAGE_NAME,REPOSITORY_NAME - script: | - # Stop and remove old container - docker stop $(echo $IMAGE_NAME) || true - docker rm $(echo $IMAGE_NAME) || true - docker image rm $(docker images '${{ env.REPOSITORY_NAME }}/${{ env.IMAGE_NAME }}' -a -q) || true - - # Set the port - if [ $(echo $IMAGE_NAME) = "ziyo-fe" ]; then - PORT=3000 - else - PORT=4200 - fi - - # Run a new container from the new image - docker run -d \ - -p $(echo $PORT):$(echo $PORT) \ - -e TYPESENSE_API_URL=${{ secrets.TYPESENSE_API_URL }} \ - -e TYPESENSE_API_KEY=${{ secrets.TYPESENSE_API_KEY }} \ - --restart always \ - --name $(echo $IMAGE_NAME) \ - $(echo $REPOSITORY_NAME)/$(echo $IMAGE_NAME):latest \ No newline at end of file