fix CD
Some checks failed
CI / build-test (push) Successful in 1m49s
Deploy Staging (Docker) / deploy (push) Failing after 48s

This commit is contained in:
Do Manh Phuong 2026-05-10 22:37:30 +07:00
parent b4331b0fbd
commit 03e29a66f7

View File

@ -22,13 +22,16 @@ jobs:
docker push $IMAGE:staging-${{ github.sha }} docker push $IMAGE:staging-${{ github.sha }}
docker push $IMAGE:staging-latest docker push $IMAGE:staging-latest
- name: Deploy local - name: Deploy local (docker compose)
env: env:
IMAGE: ${{ secrets.REGISTRY_URL }}/${{ secrets.IMAGE_NAME }} IMAGE: ${{ secrets.REGISTRY_URL }}/${{ secrets.IMAGE_NAME }}
CONTAINER_NAME: ${{ secrets.CONTAINER_NAME }}
HOST_PORT: ${{ secrets.HOST_PORT }}
run: | run: |
COMPOSE_FILE=/home/compmanage/docker-compose.yml
OVERRIDE_FILE=/tmp/ttmt-frontend.override.yml
cat > $OVERRIDE_FILE <<EOF
services:
frontend:
image: $IMAGE:staging-${{ github.sha }}
EOF
docker pull $IMAGE:staging-${{ github.sha }} docker pull $IMAGE:staging-${{ github.sha }}
docker stop $CONTAINER_NAME || true docker compose -f $COMPOSE_FILE -f $OVERRIDE_FILE up -d --no-deps --force-recreate frontend
docker rm $CONTAINER_NAME || true
docker run -d --name $CONTAINER_NAME -p $HOST_PORT:80 $IMAGE:staging-${{ github.sha }}