From b78baa4502c7132ee7e634a52a4256d46cd77b43 Mon Sep 17 00:00:00 2001 From: Stepan Vladovskiy Date: Sun, 5 May 2024 15:39:11 -0300 Subject: [PATCH] feat: gitea workflow push repo in v2 if main and to staging if dev --- .gitea/workflows/main.yml | 22 ++++++++++++++-------- .gitignore | 3 ++- README.md | 15 +++++++++++++++ 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 587c919..3a081ba 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -1,8 +1,5 @@ -name: 'deploy' -on: - push: - branches: - - main +name: 'Deploy on Push' +on: [push] jobs: deploy: @@ -21,10 +18,19 @@ jobs: id: branch_name run: echo "::set-output name=branch::$(echo ${GITHUB_REF##*/})" - - name: Push to dokku + - name: Push to dokku for main branch + if: github.ref == 'refs/heads/main' uses: dokku/github-action@master with: branch: 'main' - git_remote_url: 'ssh://dokku@staging.discours.io:22/${{ steps.repo_name.outputs.repo }}' + git_remote_url: 'ssh://dokku@v2.discours.io:22/uploader' ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} - git_push_flags: '--force' + + - name: Push to dokku for staging branch + if: github.ref == 'refs/heads/dev' + uses: dokku/github-action@master + with: + branch: 'main' + git_remote_url: 'ssh://dokku@stagging.discours.io:22/uploader' + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} + diff --git a/.gitignore b/.gitignore index 871cfd6..f2f4f01 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ __pycache__ .ruff_cache .pytest_cache .venv -*.gz.tar \ No newline at end of file +*.gz.tar +DELETEME diff --git a/README.md b/README.md index fdf659d..a0ae99d 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,18 @@ poetry env use .venv/bin/python3.12 poetry update poetry run python main.py ``` +### Интеграция в Core + +Добавить в nginx.conf.sigil ссылку на /upload +``` +# Custom location block for /upload +location /connect/ { + http://upload-8080/; + {{ $proxy_settings }} + {{ $gzip_settings }} + {{ $cors_headers_options }} + {{ $cors_headers_post }} + {{ $cors_headers_get }} +} +``` +при такой структуре ссылка будет core.domain.com/upload \ No newline at end of file