Skip to content

Commit

Permalink
fix: workflow remove deploy step
Browse files Browse the repository at this point in the history
  • Loading branch information
masnormen committed Dec 15, 2024
1 parent 37692bc commit 9ed9655
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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

0 comments on commit 9ed9655

Please sign in to comment.