feat: auto-deployment script
This commit is contained in:
parent
502edd8263
commit
2fd544c0a7
2 changed files with 36 additions and 0 deletions
23
.github/workflows/ssh-deploy.yml
vendored
Normal file
23
.github/workflows/ssh-deploy.yml
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
name: SSH Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
remote-update:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Load SSH key
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
|
||||
|
||||
- name: SSH and run deployment script
|
||||
run: |
|
||||
ssh -i ~/.ssh/id_ed25519 ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} \
|
||||
'cd ${{ secrets.SOURCE_DIR }} && git pull && sh ./deploy.sh ${{ secrets.SOURCE_DIR }} ${{ secrets.HTML_DIR }}'
|
||||
13
deploy.sh
Executable file
13
deploy.sh
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Deployment script to be run remotely on push to master at https://github.com/ViossaDiskordServer/ViossaDotNet/
|
||||
#
|
||||
# Usage: sh ./deploy.sh SOURCE_DIR STATIC_DIRECTORY
|
||||
#
|
||||
|
||||
pwd
|
||||
cd $1/apps/vdn-static/ || exit
|
||||
|
||||
npx turbo build \
|
||||
&& cp -r ./dist/* $2
|
||||
Loading…
Add table
Add a link
Reference in a new issue