-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add github action to deploy main (#44)
- Loading branch information
1 parent
a1c5357
commit 8cb7640
Showing
1 changed file
with
35 additions
and
0 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,35 @@ | ||
name: Deploy main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "ui/**" | ||
- "server/**" | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up SSH key | ||
env: | ||
SSH_KEY_BASE64: ${{ secrets.SSH_KEY_BASE64 }} | ||
run: | | ||
echo "$SSH_KEY_BASE64" | base64 --decode > ${HOME}/multiwoven-deployments.pem | ||
chmod 600 ${HOME}/multiwoven-deployments.pem | ||
- name: Deploy main | ||
env: | ||
SSH_HOST: ${{ secrets.SSH_HOST }} | ||
SSH_USER: ${{ secrets.SSH_USER }} | ||
run: | | ||
ssh -o StrictHostKeyChecking=no -i ${HOME}/multiwoven-deployments.pem $SSH_USER@$SSH_HOST << 'EOF' | ||
cd multiwoven | ||
git pull origin main | ||
docker-compose down | ||
docker-compose up -d --build | ||
EOF |