Skip to content

updated deploy.yml

updated deploy.yml #10

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
workflow_dispatch:
workflow_run:
workflows: ["Run Tests"]
types:
- completed
jobs:
deploy:

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

View workflow run for this annotation

GitHub Actions / Deploy

Invalid workflow file

The workflow is not valid. .github/workflows/deploy.yml (Line: 14, Col: 5): The workflow must contain at least one job with no dependencies.
name: "Deploy to VPS"
runs-on: ubuntu-latest
needs: trigger-tests
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Configure SSH
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/deploy-key.pem
chmod 600 ~/.ssh/deploy-key.pem
cat >> ~/.ssh/config <<END
Host my-vps
HostName $SSH_IP
User $SSH_USER
IdentityFile ~/.ssh/deploy-key.pem
StrictHostKeyChecking no
END
env:
SSH_USER: ${{ secrets.SSH_USER }}
SSH_IP: ${{ secrets.SSH_IP }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Deploy site
run: ssh my-vps '~/redeploy-site.sh'
- name: Print Container Status
run: ssh my-vps 'docker-compose ps'
- name: Send Discord Notification
run: curl -s -X POST "${{ secrets.DISCORD_WEBHOOK }}" -d "content=🚀 Deployment Successful"
failure-notification:
name: "Notify Failure"
runs-on: ubuntu-latest
needs: deploy
if: ${{ failure() }}
steps:
- name: Send Discord Notification on Failure
run: curl -s -X POST "${{ secrets.DISCORD_WEBHOOK }}" -d "content=🚨 Deployment Failed"