From 077fdfbb02aa7f6ba9304029153808e08daabd6a Mon Sep 17 00:00:00 2001 From: Alvaro Maldonado Mateos Date: Thu, 2 May 2024 08:07:14 +0200 Subject: [PATCH 1/3] removing http redirection to allow certbot renewal --- client/nginx.conf | 6 ------ docker-compose.yaml | 1 - 2 files changed, 7 deletions(-) diff --git a/client/nginx.conf b/client/nginx.conf index 9ee27da..8eb545b 100644 --- a/client/nginx.conf +++ b/client/nginx.conf @@ -15,12 +15,6 @@ http { include mime.types; sendfile on; - server { - listen 8080; - server_name substrait-fiddle.com; - return 301 https://$host$request_uri; - } - server { listen 443 ssl; diff --git a/docker-compose.yaml b/docker-compose.yaml index bc4e69d..db478cd 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -17,7 +17,6 @@ services: args: - VITE_SESSION_SECRET=$VITE_SESSION_SECRET ports: - - "80:8080" - "443:443" networks: - fiddle-network From 507ddcf2d2ec617bf031842a585186ac32bf4779 Mon Sep 17 00:00:00 2001 From: Alvaro Maldonado Mateos Date: Thu, 2 May 2024 08:19:19 +0200 Subject: [PATCH 2/3] also adding auto deploy once a month, in case of a certificate renewal --- .github/workflows/deploy-api-client.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy-api-client.yml b/.github/workflows/deploy-api-client.yml index c19cfe0..53c064f 100644 --- a/.github/workflows/deploy-api-client.yml +++ b/.github/workflows/deploy-api-client.yml @@ -10,6 +10,8 @@ on: - '.github/workflows/deploy-api-client.yml' - 'docker-compose.yaml' workflow_dispatch: + schedule: + - cron: '0 0 15 * *' permissions: actions: write From 87201895945d3895fd1997906d40f0cc24a90fbe Mon Sep 17 00:00:00 2001 From: Alvaro Maldonado Mateos Date: Thu, 2 May 2024 08:38:19 +0200 Subject: [PATCH 3/3] Also adding a step to clean up resources so we have free space --- .github/workflows/deploy-api-client.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/deploy-api-client.yml b/.github/workflows/deploy-api-client.yml index 53c064f..65eae79 100644 --- a/.github/workflows/deploy-api-client.yml +++ b/.github/workflows/deploy-api-client.yml @@ -55,3 +55,15 @@ jobs: docker-compose rm -f docker-compose build --no-cache docker-compose up -d + + - name: Cleanup unused docker images, volumes and build cache + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.DEPLOY_HOST_DNS }} + username: ${{ secrets.DEPLOY_USERNAME }} + key: ${{ secrets.DEPLOY_SSH_KEY }} + script: | + docker container prune -f + docker image prune -f + docker volume prune -f + docker builder prune -f