Update deploy.yml #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
- release/* | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Git for sparse checkout | |
run: | | |
git init | |
git remote add origin https://github.com/TechTOnions/TechTOnions_Discord_Bot | |
git config core.sparseCheckout true | |
echo "Frontend/" > .git/info/sparse-checkout | |
git pull origin 'main' | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Install dependencies | |
run: npm install | |
- name: Build the project | |
run: npm run build | |
- name: Deploy to Server | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} # Secret for SSH private key | |
SSH_HOST: ${{ secrets.SSH_HOST }} # Secret for SSH host | |
SSH_USERNAME: ${{ secrets.SSH_USERNAME }} # Secret for SSH username | |
run: | | |
echo "$SSH_PRIVATE_KEY" > private_key | |
chmod 600 private_key | |
rsync -avz --delete -e "ssh -i private_key -o StrictHostKeyChecking=no" /www/wwwroot/TechTOnions_Bot/Frontend/ $SSH_USERNAME@$SSH_HOST:/path/to/deploy |