systems-obscure/.forgejo/workflows/deploy.yaml

61 lines
1.7 KiB
YAML
Raw Normal View History

2025-07-08 17:23:45 +01:00
# name: Deploy Blog
# on:
# push:
# branches: [main]
2025-07-08 17:14:00 +01:00
# jobs:
# deploy:
# runs-on: ubuntu-latest
2025-07-08 17:23:45 +01:00
# container:
# image: node:18
# volumes:
# - /var/www/systemsobscure.blog:/output
# steps:
# - uses: actions/checkout@v3
# - run: npm install
# - run: npm run build:posts
# - run: npm run build
# - name: Deploy files
# run: |
# mkdir -p /output
# rm -rf /output/*
# cp -r dist/* /output/
# # jobs:
# deploy:
# runs-on: ubuntu-latest
2025-07-08 17:14:00 +01:00
# container: node:18
# steps:
# - uses: actions/checkout@v3
# - 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
2025-07-08 17:23:45 +01:00
name: Deploy Blog
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
container: node:18
steps:
- uses: actions/checkout@v3
2025-07-08 17:28:04 +01:00
- name: Create dummy file and deploy
2025-07-08 17:23:45 +01:00
run: |
2025-07-08 17:28:04 +01:00
echo "test content" > test.txt
2025-07-08 17:23:45 +01:00
echo "${{ secrets.SSH_PRIVATE_KEY }}" > /tmp/ssh_key
chmod 600 /tmp/ssh_key
2025-07-08 17:28:04 +01:00
ssh -i /tmp/ssh_key -o StrictHostKeyChecking=no thomas@172.17.0.1 "rm -rf /var/www/systemsobscure.blog/*"
scp -i /tmp/ssh_key -o StrictHostKeyChecking=no test.txt thomas@172.17.0.1:/var/www/systemsobscure.blog/
2025-07-08 17:23:45 +01:00
rm /tmp/ssh_key