Skip to content

Bugfix/access config db before db is running #1

Bugfix/access config db before db is running

Bugfix/access config db before db is running #1

on:
pull_request:
types:
- closed
permissions:
contents: write
pull-requests: write
packages: write
name: Remove test deploy
env:
- REGISTRY: ${{vars.REGISTRY_NAME}}

Check failure on line 14 in .github/workflows/remove-test-deploy.yml

View workflow run for this annotation

GitHub Actions / Remove test deploy

Invalid workflow file

The workflow is not valid. .github/workflows/remove-test-deploy.yml (Line: 14, Col: 3): A sequence was not expected
jobs:
remove:
name: Remove test deploying
runs-on: ubuntu-latest
env:
TEST_DEPLOY_IMAGE_NAME: ticklabvn/ssps-be-test-deploy
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.base.ref == 'test/staging'
steps:
- name: remove
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
port: ${{ secrets.VPS_PORT }}
username: ${{ secrets.VPS_USERNAME }}
password: ${{ secrets.VPS_PASSWORD }}
script: |
# Remove the test deploy container, image, and folder
cd $HOME/${{ env.TEST_DEPLOY_IMAGE_NAME }}
if [ $? -eq 0 ]; then
docker compose down --volumes --remove-orphans
docker image rm -f ${{ env.REGISTRY }}/${{ env.TEST_DEPLOY_IMAGE_NAME }}:latest
rm -rf $HOME/${{ env.TEST_DEPLOY_IMAGE_NAME }}
else
echo "Could not change directory to $HOME/${{ env.TEST_DEPLOY_IMAGE_NAME }}. Skipping removal."
fi