-
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.
- Loading branch information
Showing
2 changed files
with
44 additions
and
5 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,38 @@ | ||
name: Deploy from Master | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to Digital Ocean droplet via SSH action | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_KEY }} | ||
passphrase: ${{ secrets.SSH_PASSPHRASE }} | ||
command_timeout: 60m | ||
script: | | ||
ls | ||
cd /home/treeckle/Treeckle-3.0 | ||
# Temp store changes | ||
git stash | ||
# Pull from git repo | ||
git checkout master || true # Force return true so exit code is not 1 | ||
git pull | ||
# Build | ||
cd frontend | ||
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S bash ./build-prod.sh | ||
cd .. | ||
echo "${{ secrets.SUDO_PASSWORD }}" | sudo docker-compose -f ./docker-compose.prod.yml up -d | ||
# Restore changes | ||
git stash pop |
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