Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
ci: deploy backend on push
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemSBulgakov committed Nov 29, 2024
1 parent 291a7f0 commit e44d293
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build static files and deploy
name: Build and deploy

on:
# Allow manual trigger of the workflow
Expand All @@ -9,7 +9,7 @@ on:
jobs:
build-frontend:
if: github.repository_owner == 'one-zero-eight'
name: Build static files
name: Build frontend
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:

deploy-frontend:
if: github.repository_owner == 'one-zero-eight'
name: Deploy to server
name: Deploy frontend
needs: build-frontend
runs-on: ubuntu-latest
steps:
Expand All @@ -71,3 +71,22 @@ jobs:
strip_components: 1
overwrite: true
rm: true

deploy-backend:
if: github.repository_owner == 'one-zero-eight'
name: Deploy backend
runs-on: ubuntu-latest
steps:
- name: Deploy via SSH
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
script_stop: true # Stop script on error
command_timeout: 30m
script: |
cd "${{ secrets.SSH_REPOSITORY }}"
git pull origin main
cd backend
docker compose up -d --build --pull always

0 comments on commit e44d293

Please sign in to comment.