Skip to content

Commit

Permalink
Update deploy_test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargi Ketan Chauhan authored and GitHub Enterprise committed Mar 4, 2025
1 parent 7532e9d commit 6dc691a
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions .github/workflows/deploy_test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Continuous Deployment to TDT4242 server
name: Continuous Development Deploy to TDT4242 server

on:
push:
branches:
- main
- develop # Or your development branch
workflow_dispatch:
inputs:
config:
Expand All @@ -17,17 +17,11 @@ on:
- "docker-compose.yml"

jobs:
build-and-deploy:
deploy:
runs-on: self-hosted
container:
image: docker:20.10.7
options: --privileged
volumes:
- /var/run/docker.sock:/var/run/docker.sock

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

steps:
- name: Checkout repository
Expand All @@ -39,24 +33,15 @@ jobs:
export-variables: true
keys-case: bypass

- name: Set Docker socket permissions
run: sudo -E chmod 666 /var/run/docker.sock

- name: Check status of config file
run: |
sudo -E env
sudo -E docker compose version
env
docker compose version
cd $GITHUB_WORKSPACE
sudo -E docker compose -f $COMPOSE_FILE --verbose config && printf 'OK\n' || exit 1
docker compose -f $COMPOSE_FILE --verbose config && printf "OK\n" || exit 1
- name: Build and run docker image
run: sudo -E docker compose -f $COMPOSE_FILE up --force-recreate --build -d
run: docker compose -f $COMPOSE_FILE up --force-recreate --build -d

- name: Verify that gateway is available
run: sudo -E docker ps






run: docker ps

0 comments on commit 6dc691a

Please sign in to comment.