systems-obscure/.forgejo/workflows/deploy.yaml
thomasabishop 00117f619d
Some checks failed
Deploy Blog / deploy (push) Failing after 10s
fix: forgejo deploy - add NodeJS to container
2025-07-08 17:01:41 +01:00

65 lines
1.6 KiB
YAML

# name: Deploy site
# on:
# push:
# branches: [main]
# jobs:
# deploy:
# runs-on: ubuntu-latest
# container: node:18
# steps:
# - uses: actions/checkout@v3
# - run: npm install
# - run: npm run build:posts
# - run: npm run build
# - run: |
# cp -r dist/* /var/www/systemsobscure.blog/
# chown -R www-data:www-data /var/www/systemsobscure.blog/
#
# name: Deploy Blog
# on:
# push:
# branches: [main]
# jobs:
# deploy:
# runs-on: ubuntu-latest
# container:
# image: node:18
# volumes:
# - /var/www:/var/www
# steps:
# - uses: actions/checkout@v3
# - run: npm install
# - run: npm run build:posts
# - run: npm run build
# - run: cp -r dist/* /var/www/systemsobscure.blog/
name: Deploy Blog
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Node.js
run: |
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
- run: npm install
- run: npm run build:posts
- run: npm run build
- name: Deploy via SSH
run: |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > /tmp/ssh_key
chmod 600 /tmp/ssh_key
ssh -i /tmp/ssh_key -o StrictHostKeyChecking=no thomas@localhost "rm -rf /var/www/systemsobscure.blog/*"
scp -i /tmp/ssh_key -o StrictHostKeyChecking=no -r dist/* thomas@localhost:/var/www/systemsobscure.blog/
rm /tmp/ssh_key