Files
touch-programming/.github/workflows/deploy.yaml
T
2025-04-10 17:45:19 +01:00

47 lines
991 B
YAML

name: Deployment to VPS
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 18
- name: Build client
run: |
cd client
npm install
npm run build
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23.x'
- name: Build server
run: |
cd server
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o executable
- name: Setup SSH
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.DEPLOY_SSH_KEY }}
if_key_exists: ignore
- name: Deploy to VPS
run: |
scp -r client/build deploy@hazemkrimi.tech:/var/www/touch-programming.hazemkrimi.tech/public
scp server/executable deploy@hazemkrimi.tech:/var/www/touch-programming.hazemkrimi.tech/api