Skip to content

Commit

Permalink
deployment(backend): add basic CD workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-sarfraz committed Sep 25, 2024
1 parent 902f6fb commit 563f59d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/Backend-CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Backend CD

on:
workflow_run:
workflows: ["Backend CI"]
types:
- completed

jobs:
build:
runs-on: self-hosted

steps:
- uses: actions/checkout@v4

- name: Pull Docker image
run: sudo docker compose pull

- name: Start Containers
env:
ENVIRONMENT: ${{ secrets.ENVIRONMENT }}
DB_NAME: ${{ secrets.DB_NAME}}
DB_USER: ${{ secrets.DB_USER}}
DB_HOST: ${{ secrets.DB_HOST}}
DB_PORT: ${{ secrets.DB_PORT}}
DB_PASSWORD: ${{ secrets.DB_PASSWORD}}
PORT: ${{ secrets.PORT}}
KEY: ${{ secrets.KEY}}
SECTRET: ${{ secrets.SECTRET}}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY}}
run: sudo docker compose up --force-recreate
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ jobs:
env:
ENVIRONMENT: ${{ secrets.ENVIRONMENT }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
DB_NAME: ${{ secrets.DB_NAME}}
DB_USER: ${{ secrets.DB_USER}}
DB_HOST: ${{ secrets.DB_HOST}}
DB_PORT: ${{ secrets.DB_PORT}}
DB_PASSWORD: ${{ secrets.DB_PASSWORD}}
PORT: ${{ secrets.PORT}}
KEY: ${{ secrets.KEY}}
SECTRET: ${{ secrets.SECTRET}}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY}}
run: |
docker compose build backend
docker compose build graphql
Expand Down

0 comments on commit 563f59d

Please sign in to comment.