mirror of
https://github.com/karpathy/nanochat.git
synced 2026-06-01 20:48:11 +00:00
add CI/CD auto-deploy workflow for samosaChaat
Deploys to EC2 on push to master when UI/server files change. Uses appleboy/ssh-action with stored secrets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c767741b42
commit
c3f683f3e3
30
.github/workflows/deploy.yml
vendored
Normal file
30
.github/workflows/deploy.yml
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
name: Deploy samosaChaat to EC2
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'nanochat/ui.html'
|
||||
- 'nanochat/logo.svg'
|
||||
- 'scripts/chat_web.py'
|
||||
- 'scripts/chat_cli.py'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Deploy to EC2
|
||||
uses: appleboy/ssh-action@v1
|
||||
with:
|
||||
host: ${{ secrets.EC2_HOST }}
|
||||
username: ubuntu
|
||||
key: ${{ secrets.EC2_SSH_KEY }}
|
||||
script: |
|
||||
cd /home/ubuntu/nanochat
|
||||
git fetch origin master
|
||||
git reset --hard origin/master
|
||||
sudo systemctl restart samosachaat.service
|
||||
echo "Deploy complete - samosaChaat restarted"
|
||||
Loading…
Reference in New Issue
Block a user