-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from BBai-Tips/staging
BUI startDir preference and case-insensitive project searching
- Loading branch information
Showing
12 changed files
with
149 additions
and
73 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Deploy to Chat server | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # or your default branch name | ||
workflow_dispatch: # Allows manual triggering | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Deno | ||
uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.x # Use the latest Deno version | ||
|
||
- name: Build site | ||
run: | | ||
cd bui/src/ | ||
deno task build | ||
- name: Install SSH key | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.SERVER_SSH_KEY }} | ||
known_hosts: ${{ secrets.KNOWN_HOSTS }} | ||
|
||
- name: Deploy to Chat server | ||
env: | ||
HOST: site.bbai.tips | ||
USER: deploy | ||
DEPLOY_PATH: "/var/www/chat.bbai.tips/bbai/bui/src" | ||
TEMP_DEPLOY_PATH: "/home/deploy/temp_deploy" | ||
run: | | ||
# Install rsync if not already installed | ||
if ! command -v rsync &> /dev/null; then | ||
sudo apt-get update | ||
sudo apt-get install -y rsync | ||
fi | ||
ssh $USER@$HOST << EOF | ||
# Create temporary directory for deployment | ||
mkdir -p $TEMP_DEPLOY_PATH | ||
EOF | ||
# Deploy the built files to temporary directory | ||
rsync -avz --delete bui/src/ $USER@$HOST:$TEMP_DEPLOY_PATH/ | ||
ssh $USER@$HOST << EOF | ||
# Move files from temporary directory to final location | ||
#echo rsync -avz --delete $TEMP_DEPLOY_PATH/ $DEPLOY_PATH/ | ||
sudo rsync -avz --delete $TEMP_DEPLOY_PATH/ $DEPLOY_PATH/ | ||
# Set correct ownership and permissions | ||
#echo chown -R www-data:www-data $DEPLOY_PATH/ | ||
sudo chown -R www-data:www-data $DEPLOY_PATH/ | ||
#echo find $DEPLOY_PATH/ -type d -exec chmod 755 {} \; | ||
sudo find $DEPLOY_PATH/ -type d -exec chmod 755 {} \; | ||
#echo find $DEPLOY_PATH/ -type f -exec chmod 644 {} \; | ||
sudo find $DEPLOY_PATH/ -type f -exec chmod 644 {} \; | ||
# Clean up temporary directory | ||
rm -rf $TEMP_DEPLOY_PATH | ||
# Restart the service | ||
sudo systemctl restart bbai-bui.service | ||
EOF |
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
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
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
Oops, something went wrong.