Skip to content

Commit

Permalink
Update deploy_test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Garima Ketan Chauhan authored and GitHub Enterprise committed Apr 2, 2025
1 parent 640dff8 commit 58c7752
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/deploy_test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
name: Production Deployment Workflow
name: Continuous Development Deploy to TDT4242 server

on:
push:
branches:
- gargi-production # Trigger only for production branch
- gargi # Or your development branch
workflow_dispatch:
inputs:
config:
description: "Which compose config file to deploy"
required: true
default: "docker-compose.dev.yml"
type: choice
options:
- "docker-compose.dev.yml"
- "docker-compose.stag.yml"
- "docker-compose.yml"

jobs:
deploy:
runs-on: self-hosted
env:
REPO_NAME: ${{ github.event.repository.name }}
COMPOSE_FILE: docker-compose.yml
COMPOSE_FILE: ${{ github.event.inputs.config || 'docker-compose.dev.yml' }} # Use default if not provided

steps:
- name: Checkout repository
Expand All @@ -21,15 +32,13 @@ jobs:
with:
export-variables: true
keys-case: bypass

- name: Set up test containers
run: docker-compose -f docker-compose.stag.yml up --build -d

- name: Run backend unit tests
run: docker exec secfit_stag_backend python manage.py test tests

- name: Tear down test containers
run: docker-compose -f docker-compose.stag.yml down
- name: Check status of config file
run: |
env
docker compose version
cd $GITHUB_WORKSPACE
docker compose -f $COMPOSE_FILE --verbose config && printf "OK\n" || exit 1
- name: Build and run docker image
run: docker compose -f $COMPOSE_FILE up --force-recreate --build -d
Expand Down

0 comments on commit 58c7752

Please sign in to comment.