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 94f8359 commit b58f7e3
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions .github/workflows/deploy_test.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
name: Continuous Development Deploy to TDT4242 server
name: Production Deployment Workflow

on:
push:
branches:
- gargi-production # 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"
- gargi-production # Trigger only for production branch

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

steps:
- name: Checkout repository
Expand All @@ -32,13 +21,15 @@ 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: 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: 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: Build and run docker image
run: docker compose -f $COMPOSE_FILE up --force-recreate --build -d
Expand Down

0 comments on commit b58f7e3

Please sign in to comment.