Skip to content

Commit

Permalink
Update deploy_test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jifollan authored and GitHub Enterprise committed Mar 20, 2025
1 parent 2742cfc commit ce225a8
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 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 # Trigger on push to the main branch
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' }} # Default to dev config if not specified

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

- name: Dotenv Action
uses: falti/dotenv-action@v1.1.4
with:
Expand All @@ -34,10 +38,17 @@ jobs:
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

docker compose -f $COMPOSE_FILE --verbose config && printf "OK\n" || exit 1
- name: Build and run docker images
run: |
cd $GITHUB_WORKSPACE
docker compose -f $COMPOSE_FILE down # Stop and remove existing containers
docker compose -f $COMPOSE_FILE up --force-recreate --build -d # Rebuild and start containers
- name: Verify that gateway is available
run: docker ps
run: |
docker ps
echo "Waiting for gateway to start..."
sleep 10 # Wait for the gateway to start
curl -I http://localhost:20436 || exit 1 # Verify gateway is accessible

0 comments on commit ce225a8

Please sign in to comment.