Skip to content

Commit e64e051

Browse files
authored
Refactor Docker setup steps in deployment workflow
1 parent 6b81613 commit e64e051

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

.github/workflows/00-deployment-verification.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,49 +19,56 @@ jobs:
1919
steps:
2020
- name: Checkout repository
2121
uses: actions/checkout@v6
22-
- name: Upgrade Docker daemon
22+
23+
- name: Ensure Docker is ready
2324
run: |
24-
curl -fsSL https://get.docker.com | sudo sh
25-
sudo systemctl stop docker
26-
sudo rm -f /var/run/docker.sock
27-
sudo systemctl start docker
28-
sleep 10
2925
docker version
26+
docker compose version
27+
3028
- name: Create necessary Docker networks
3129
run: |
3230
docker network create $NETWORK_ONE || true
3331
docker network create $NETWORK_TWO || true
32+
3433
- name: Modify /etc/hosts for internal routing
3534
run: |
3635
echo "127.0.0.1 $APP_HOSTNAME" | sudo tee -a /etc/hosts
3736
echo "127.0.0.1 $APP_TRAEFIK_HOSTNAME" | sudo tee -a /etc/hosts
37+
3838
- name: Start up services using Docker Compose
3939
run: docker compose -f $DOCKER_COMPOSE_FILE -p $COMPOSE_PROJECT_NAME up -d
40+
4041
- name: Print Docker Compose services status
4142
run: docker ps
43+
4244
- name: Show container logs on startup
4345
run: docker compose -f $DOCKER_COMPOSE_FILE -p $COMPOSE_PROJECT_NAME logs --tail=50
46+
4447
- name: Wait for the application to be ready via Traefik
4548
run: |
4649
echo "Checking the routing and availability of the application via Traefik..."
4750
timeout 5m bash -c 'while ! curl -fsSLk "https://$APP_HOSTNAME"; do \
4851
echo "Waiting for the application to be ready..."; \
4952
sleep 10; \
5053
done'
54+
5155
- name: Wait for the Traefik dashboard to be ready
5256
run: |
5357
echo "Checking the routing and availability of the Traefik dashboard..."
5458
timeout 5m bash -c 'while ! curl -fsSLk --write-out "%{http_code}" --output /dev/null "https://$APP_TRAEFIK_HOSTNAME" | grep -E "200|401"; do \
5559
echo "Waiting for the application to be ready..."; \
5660
sleep 10; \
5761
done'
62+
5863
- name: Inspect Network Configuration
5964
run: |
6065
docker network inspect $NETWORK_ONE
6166
docker network inspect $NETWORK_TWO
67+
6268
- name: Show container logs on failure
6369
if: failure()
6470
run: docker compose -f $DOCKER_COMPOSE_FILE -p $COMPOSE_PROJECT_NAME logs
71+
6572
- name: Shutdown Docker Compose services
6673
if: always()
6774
run: docker compose -f $DOCKER_COMPOSE_FILE -p $COMPOSE_PROJECT_NAME down

0 commit comments

Comments
 (0)