aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCopilot <198982749+Copilot@users.noreply.github.com>2025-10-21 18:47:55 +0200
committerGitHub <noreply@github.com>2025-10-21 18:47:55 +0200
commitc32f83bf7315e56452b6244c477ddd9ff651bce2 (patch)
treed811b6dfa400e975c4967e35d514ba3bb0975aa6
parentcdb88746ef0a4cfb4ffa277a83ab17397ad76610 (diff)
Add backend deployment to existing workflow with linux-arm64 support (#55)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: arielcostas <94913521+arielcostas@users.noreply.github.com>
-rw-r--r--.github/workflows/deploy.yml43
1 files changed, 38 insertions, 5 deletions
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 423fa46..ed72a82 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -6,9 +6,9 @@ on:
- main
jobs:
- build:
+ build-frontend:
runs-on: ubuntu-latest
- name: Build production artifact
+ name: Build frontend artifact
environment: Production
steps:
- uses: actions/checkout@v5
@@ -38,17 +38,45 @@ jobs:
path: dist
retention-days: 7
+ build-backend:
+ runs-on: ubuntu-latest
+ name: Build backend artifact
+ environment: Production
+ permissions:
+ contents: read
+ steps:
+ - uses: actions/checkout@v5
+ with:
+ submodules: true
+ lfs: false
+ - uses: actions/setup-dotnet@v5
+ with:
+ dotnet-version: '9.0.x'
+ - name: Build backend
+ run: dotnet publish -c Release -r linux-arm64 --self-contained false src/Costasdev.Busurbano.Backend/Costasdev.Busurbano.Backend.csproj -o dist/backend
+ - name: Archive Backend Artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: backend
+ path: dist/backend
+ retention-days: 7
+
deploy:
runs-on: ubuntu-latest
- needs: build
+ needs: [build-frontend, build-backend]
name: Deploy to production server
environment: Production
steps:
- - name: Download Artifact
+ - name: Download Frontend Artifact
uses: actions/download-artifact@v5
with:
name: production
path: dist
+ - name: Download Backend Artifact
+ uses: actions/download-artifact@v5
+ with:
+ name: backend
+ path: dist/backend
- name: Connect to tailnet
uses: tailscale/github-action@v3
with:
@@ -67,6 +95,11 @@ jobs:
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H ${{ secrets.TARGET_HOST }} >> ~/.ssh/known_hosts
- - name: Deploy
+ - name: Deploy frontend
run: |
scp -r dist/frontend/* ${{ secrets.TARGET_USER }}@${{ secrets.TARGET_HOST }}:${{ secrets.TARGET_PATH }}/
+ - name: Deploy backend
+ run: |
+ ssh ${{ secrets.TARGET_USER }}@${{ secrets.TARGET_HOST }} "sudo systemctl stop busurbano"
+ scp -r dist/backend/* ${{ secrets.TARGET_USER }}@${{ secrets.TARGET_HOST }}:/opt/ventasync/
+ ssh ${{ secrets.TARGET_USER }}@${{ secrets.TARGET_HOST }} "sudo systemctl start busurbano"