Skip to content

Commit 99fc29f

Browse files
committed
CD update
1 parent ef25368 commit 99fc29f

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ jobs:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
1717

18+
- name: Install Docker Compose CLI
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install -y docker-compose-plugin
22+
docker compose version
23+
1824
- name: Set up Docker Buildx
1925
uses: docker/setup-buildx-action@v3
2026

@@ -45,17 +51,21 @@ jobs:
4551
STAGING_API_TOKENS: ${{ secrets.STAGING_API_TOKENS }}
4652
run: |
4753
echo "Deploying to staging environment..."
48-
docker-compose -f docker-compose.staging.yml down || true
49-
docker-compose -f docker-compose.staging.yml pull
50-
docker-compose -f docker-compose.staging.yml up -d
54+
docker compose -f docker-compose.staging.yml down || true
55+
docker compose -f docker-compose.staging.yml pull
56+
docker compose -f docker-compose.staging.yml up -d
5157
5258
- name: Health check staging
5359
run: |
5460
echo "Performing health check on staging..."
55-
# Wait for service to be ready
5661
timeout 60 bash -c 'until curl -f http://localhost:8001/health; do sleep 2; done'
5762
echo "Staging deployment successful!"
5863
64+
- name: Print logs on failure
65+
if: failure()
66+
run: |
67+
docker compose logs
68+
5969
deploy-production:
6070
if: github.event.workflow_run.conclusion == 'success' && github.ref == 'refs/heads/main'
6171
runs-on: ubuntu-latest
@@ -65,6 +75,12 @@ jobs:
6575
- name: Checkout code
6676
uses: actions/checkout@v4
6777

78+
- name: Install Docker Compose CLI
79+
run: |
80+
sudo apt-get update
81+
sudo apt-get install -y docker-compose-plugin
82+
docker compose version
83+
6884
- name: Set up Docker Buildx
6985
uses: docker/setup-buildx-action@v3
7086

@@ -95,17 +111,21 @@ jobs:
95111
PRODUCTION_API_TOKENS: ${{ secrets.PRODUCTION_API_TOKENS }}
96112
run: |
97113
echo "Deploying to production environment..."
98-
docker-compose -f docker-compose.production.yml down || true
99-
docker-compose -f docker-compose.production.yml pull
100-
docker-compose -f docker-compose.production.yml up -d
114+
docker compose -f docker-compose.production.yml down || true
115+
docker compose -f docker-compose.production.yml pull
116+
docker compose -f docker-compose.production.yml up -d
101117
102118
- name: Health check production
103119
run: |
104120
echo "Performing health check on production..."
105-
# Wait for service to be ready
106121
timeout 60 bash -c 'until curl -f http://localhost:8000/health; do sleep 2; done'
107122
echo "Production deployment successful!"
108123
124+
- name: Print logs on failure
125+
if: failure()
126+
run: |
127+
docker compose logs
128+
109129
- name: Notify deployment success
110130
run: |
111131
echo "🚀 Deployment to production completed successfully!"

0 commit comments

Comments
 (0)