Skip to content

πŸ› CI node error fix #17

πŸ› CI node error fix

πŸ› CI node error fix #17

Workflow file for this run

name: Deploy
on:
push:
branches: main
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run lint
prepare:
needs: validate
runs-on: self-hosted
steps:
- uses: appleboy/ssh-action@master
with:
key: ${{ secrets.SSH_KEY }}
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
port: ${{ secrets.SSH_PORT }}
script: |
mkdir ~/env ~/env/${{github.event.repository.name}}
cd ~/env/${{github.event.repository.name}}
sudo git clone https://github.com/${{github.repository}} .
sudo git pull
echo '${{ secrets.APP_ENV }}' > .env
deploy:
needs: [validate, prepare]
runs-on: self-hosted
steps:
- uses: appleboy/ssh-action@master
with:
key: ${{ secrets.SSH_KEY }}
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
port: ${{ secrets.SSH_PORT }}
script: |
cd ~/env/${{github.event.repository.name}}
sudo docker-compose down
sudo docker-compose up -d