All checks were successful
Deploy / lint-build-deploy (push) Successful in 2m13s
42 lines
987 B
YAML
42 lines
987 B
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
lint-build-deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install dependencies
|
|
run: npm install --legacy-peer-deps
|
|
|
|
- name: Run linting
|
|
run: npm run lint
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Deploy to VPS
|
|
env:
|
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
|
chmod 600 ~/.ssh/id_ed25519
|
|
ssh-keyscan -H 51.210.247.57 >> ~/.ssh/known_hosts
|
|
ssh debian@51.210.247.57 << 'EOF'
|
|
cd /home/debian/newsletter-hackernews
|
|
git pull origin main
|
|
cd /home/debian/gitea
|
|
docker compose up -d --build newsletter
|
|
EOF
|