From e0b6e0cb5bc325e3b246f22b137ba4f5feb30ae4 Mon Sep 17 00:00:00 2001 From: geoffrey1330 Date: Sun, 3 Mar 2024 17:01:45 +0100 Subject: [PATCH] created action for gauzy api stage on digitalOcean droplet --- .../docker-compose.api.demo.letsencrypt.pre.yml | 4 +++- .../docker-compose.api.prod.letsencrypt.pre.yml | 3 +++ .../docker-compose.api.stage.letsencrypt.pre.yml | 3 +++ .deploy/ssh/with-letsencrypt/nginx.stage.pre.letsencrypt.conf | 1 + .github/workflows/deploy-do-droplet-pre-stage.yml | 2 +- .github/workflows/deploy-do-droplet-stage.yml | 2 +- 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.deploy/ssh/with-letsencrypt/docker-compose.api.demo.letsencrypt.pre.yml b/.deploy/ssh/with-letsencrypt/docker-compose.api.demo.letsencrypt.pre.yml index 43e64e49f22..aaaf679b2ba 100644 --- a/.deploy/ssh/with-letsencrypt/docker-compose.api.demo.letsencrypt.pre.yml +++ b/.deploy/ssh/with-letsencrypt/docker-compose.api.demo.letsencrypt.pre.yml @@ -19,7 +19,9 @@ services: volumes: - ./certbot/conf:/etc/letsencrypt:rw - ./certbot/www:/var/www/certbot:rw - + depends_on: + nginx: + condition: service_healthy command: certonly --webroot -w /var/www/certbot --force-renewal --email ever@ever.tech -d apidemodts.gauzy.co --agree-tos volumes: certificates: {} diff --git a/.deploy/ssh/with-letsencrypt/docker-compose.api.prod.letsencrypt.pre.yml b/.deploy/ssh/with-letsencrypt/docker-compose.api.prod.letsencrypt.pre.yml index da89ab98bf0..f6c78dcabd1 100644 --- a/.deploy/ssh/with-letsencrypt/docker-compose.api.prod.letsencrypt.pre.yml +++ b/.deploy/ssh/with-letsencrypt/docker-compose.api.prod.letsencrypt.pre.yml @@ -19,6 +19,9 @@ services: volumes: - ./certbot/conf:/etc/letsencrypt:rw - ./certbot/www:/var/www/certbot:rw + depends_on: + nginx: + condition: service_healthy command: certonly --webroot -w /var/www/certbot --force-renewal --email ever@ever.tech -d apidts.gauzy.co --agree-tos volumes: certificates: {} diff --git a/.deploy/ssh/with-letsencrypt/docker-compose.api.stage.letsencrypt.pre.yml b/.deploy/ssh/with-letsencrypt/docker-compose.api.stage.letsencrypt.pre.yml index cde31446725..3285dea2cba 100644 --- a/.deploy/ssh/with-letsencrypt/docker-compose.api.stage.letsencrypt.pre.yml +++ b/.deploy/ssh/with-letsencrypt/docker-compose.api.stage.letsencrypt.pre.yml @@ -19,6 +19,9 @@ services: volumes: - ./certbot/conf:/etc/letsencrypt:rw - ./certbot/www:/var/www/certbot:rw + depends_on: + nginx: + condition: service_healthy command: certonly --webroot -w /var/www/certbot --force-renewal --email ever@ever.tech -d apistagedts.gauzy.co --agree-tos volumes: certificates: {} diff --git a/.deploy/ssh/with-letsencrypt/nginx.stage.pre.letsencrypt.conf b/.deploy/ssh/with-letsencrypt/nginx.stage.pre.letsencrypt.conf index 4a2df8e9e8e..bf7878fa7f7 100644 --- a/.deploy/ssh/with-letsencrypt/nginx.stage.pre.letsencrypt.conf +++ b/.deploy/ssh/with-letsencrypt/nginx.stage.pre.letsencrypt.conf @@ -11,6 +11,7 @@ http { allow all; root /var/www/certbot; } + location / { return 301 https://$host$request_uri; } diff --git a/.github/workflows/deploy-do-droplet-pre-stage.yml b/.github/workflows/deploy-do-droplet-pre-stage.yml index f64a6f76862..0299195cf18 100644 --- a/.github/workflows/deploy-do-droplet-pre-stage.yml +++ b/.github/workflows/deploy-do-droplet-pre-stage.yml @@ -19,7 +19,7 @@ jobs: run: | echo "INGRESS_CERT_TYPE=${{ env.INGRESS_CERT_TYPE }}" >> $GITHUB_ENV env: - INGRESS_CERT_TYPE: 'cloudflare' + INGRESS_CERT_TYPE: 'letsencrypt' - name: Generate TLS Secrets for DO Droplet run: | diff --git a/.github/workflows/deploy-do-droplet-stage.yml b/.github/workflows/deploy-do-droplet-stage.yml index 655f84d5130..04f4ca39553 100644 --- a/.github/workflows/deploy-do-droplet-stage.yml +++ b/.github/workflows/deploy-do-droplet-stage.yml @@ -27,7 +27,7 @@ jobs: echo "UNKNOWN INGRESS_CERT_TYPE" fi env: - INGRESS_CERT_TYPE: 'cloudflare' + INGRESS_CERT_TYPE: 'letsencrypt' - name: Inject secrets into .env-template.compose run: |