Skip to content

Commit

Permalink
Updated deploy_test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Sander Johansen committed Mar 5, 2025
1 parent c4ddf85 commit 5c7ffb7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/deploy_test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Deploy to TDT4242 server development

on:
push:
branches:
- main
workflow_dispatch:
inputs:
config:
Expand All @@ -18,11 +21,12 @@ jobs:
runs-on: self-hosted
env:
REPO_NAME: ${{ github.event.repository.name }}
COMPOSE_FILE: ${{ github.event.inputs.config }}
COMPOSE_FILE: ${{ github.event.inputs.config || 'docker-compose.dev.yml' }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Dotenv Action
uses: falti/dotenv-action@v1.1.4
with:
Expand All @@ -35,7 +39,10 @@ jobs:
docker compose version
cd $GITHUB_WORKSPACE
docker compose -f $COMPOSE_FILE --verbose config && printf "OK\n" || exit 1
- name: Stop existing containers
run: docker compose -f $COMPOSE_FILE down

- name: Build and run docker image
run: docker compose -f $COMPOSE_FILE up --force-recreate --build -d

Expand Down

0 comments on commit 5c7ffb7

Please sign in to comment.