From 025019b5441a424a059d1c2a29cc09935c2b8d90 Mon Sep 17 00:00:00 2001 From: Stepan Vladovskiy Date: Tue, 28 Nov 2023 14:20:19 -0300 Subject: [PATCH 1/4] feat: add ACME location --- nginx.conf.sigil | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nginx.conf.sigil b/nginx.conf.sigil index e831f3e6..80859d98 100644 --- a/nginx.conf.sigil +++ b/nginx.conf.sigil @@ -40,6 +40,14 @@ server { } } + location ~ /.well-known/acme-challenge { + allow all; + root /var/www/html; # Adjust this to the correct path where challenge files are stored + default_type "text/plain"; + try_files $uri =404; + } + + client_max_body_size 100m; include /home/dokku/{{ $.APP }}/nginx.conf.d/*.conf; From 9d8bd629abfb097a384b4fca77fa88bb91a61132 Mon Sep 17 00:00:00 2001 From: Stepan Vladovskii Date: Wed, 24 Jan 2024 19:09:54 -0300 Subject: [PATCH 2/4] feat: add CI to main for deploy on discoursio-api --- .gitea/workflows/main.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .gitea/workflows/main.yml diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml new file mode 100644 index 00000000..6b899284 --- /dev/null +++ b/.gitea/workflows/main.yml @@ -0,0 +1,25 @@ +name: 'deploy' +on: + push: + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Cloning repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Get Branch Name + id: branch_name + run: echo "::set-output name=branch::$(echo ${GITHUB_REF##*/})" + + - name: Push to dokku + uses: dokku/github-action@master + with: + ssh-private-key: ${{ secrets.DOKKU_SSH_PRIVATE_KEY }} + ssh-host: staging.discours.io + ssh-user: dokku + app-name: ${{ steps.branch_name.outputs.branch == 'main' ? 'discoursio-api' : 'core' }} + git-remote-url: ${{ steps.branch_name.outputs.branch == 'main' ? 'ssh://dokku@staging.discours.io:22/discoursio-api' : 'ssh://dokku@staging.discours.io:22/core' }} \ No newline at end of file From a8018a0b2f3d04babc2341502a6b65034202755c Mon Sep 17 00:00:00 2001 From: Stepan Vladovskii Date: Wed, 24 Jan 2024 20:39:58 -0300 Subject: [PATCH 3/4] debug: simplify main.yml for actions --- .gitea/workflows/main.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 6b899284..c634f98c 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -1,6 +1,8 @@ -name: 'deploy' +name: 'Deploy to discoursio-api' on: push: + branches: + - main jobs: deploy: @@ -11,15 +13,11 @@ jobs: with: fetch-depth: 0 - - name: Get Branch Name - id: branch_name - run: echo "::set-output name=branch::$(echo ${GITHUB_REF##*/})" - - - name: Push to dokku + - name: Push to discoursio-api uses: dokku/github-action@master with: ssh-private-key: ${{ secrets.DOKKU_SSH_PRIVATE_KEY }} ssh-host: staging.discours.io ssh-user: dokku - app-name: ${{ steps.branch_name.outputs.branch == 'main' ? 'discoursio-api' : 'core' }} - git-remote-url: ${{ steps.branch_name.outputs.branch == 'main' ? 'ssh://dokku@staging.discours.io:22/discoursio-api' : 'ssh://dokku@staging.discours.io:22/core' }} \ No newline at end of file + app-name: discoursio-api + git-remote-url: ssh://dokku@staging.discours.io:22/discoursio-api From 86111bc9f5d75f602d46d345f0bbaabce3f5dbc4 Mon Sep 17 00:00:00 2001 From: Stepan Vladovskii Date: Wed, 24 Jan 2024 20:45:34 -0300 Subject: [PATCH 4/4] debug: simplify main.yml for actions --- .gitea/workflows/main.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index c634f98c..c2cbfa60 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -1,4 +1,4 @@ -name: 'Deploy to discoursio-api' +name: 'Deploy to discoursio-api' on: push: branches: @@ -13,11 +13,20 @@ jobs: with: fetch-depth: 0 - - name: Push to discoursio-api + - name: Get Repo Name + id: repo_name + run: echo "::set-output name=repo::$(echo ${GITHUB_REPOSITORY##*/})" + + - name: Get Branch Name + id: branch_name + run: echo "::set-output name=branch::$(echo ${GITHUB_REF##*/})" + + - name: Push to dokku uses: dokku/github-action@master with: - ssh-private-key: ${{ secrets.DOKKU_SSH_PRIVATE_KEY }} - ssh-host: staging.discours.io - ssh-user: dokku - app-name: discoursio-api - git-remote-url: ssh://dokku@staging.discours.io:22/discoursio-api + branch: 'main' + git_remote_url: 'ssh://dokku@staging.discours.io:22/discoursio-api' + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} + git_push_flags: '--force' + +