From 2420297c20d08ceb5083d3d3a2ee8f99da44fe8b Mon Sep 17 00:00:00 2001 From: Stepan Vladovskiy Date: Mon, 18 Mar 2024 00:12:17 -0300 Subject: [PATCH 1/4] feat: branch dev with CI to deploy dev in staging.discour.io --- .gitea/workflows/main.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 3bdc6a4..3744b44 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -4,7 +4,6 @@ on: [push] jobs: deploy: runs-on: ubuntu-latest - if: github.ref == 'refs/heads/mailgun' steps: - name: Cloning repo uses: actions/checkout@v2 @@ -19,9 +18,18 @@ 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: steps.branch_name.outputs.branch == 'mailgun' uses: dokku/github-action@master with: branch: 'main' git_remote_url: 'ssh://dokku@v2.discours.io:22/authorizer' + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Push to dokku for dev branch + if: steps.branch_name.outputs.branch == 'dev' + uses: dokku/github-action@master + with: + branch: 'main' + git_remote_url: 'ssh://dokku@staging.discours.io:22/authorizer' ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} \ No newline at end of file From 4990a77786979adaca17b1ec00a5b4de998f17d5 Mon Sep 17 00:00:00 2001 From: Stepan Vladovskiy Date: Thu, 11 Apr 2024 17:09:38 -0300 Subject: [PATCH 2/4] feat: CI mailgun->v2 and dev->staging --- .gitea/workflows/main.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 57423b2..3744b44 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -5,7 +5,10 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Cloning repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Get Repo Name id: repo_name @@ -15,9 +18,18 @@ 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: steps.branch_name.outputs.branch == 'mailgun' uses: dokku/github-action@master with: branch: 'main' git_remote_url: 'ssh://dokku@v2.discours.io:22/authorizer' ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Push to dokku for dev branch + if: steps.branch_name.outputs.branch == 'dev' + uses: dokku/github-action@master + with: + branch: 'main' + git_remote_url: 'ssh://dokku@staging.discours.io:22/authorizer' + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} \ No newline at end of file From cfaf6c49b4de7c6eb8985a5e754ed34d7069405d Mon Sep 17 00:00:00 2001 From: Stepan Vladovskiy Date: Thu, 11 Apr 2024 17:10:55 -0300 Subject: [PATCH 3/4] feat: CI mailgun->v2 and dev->staging --- .gitea/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 3744b44..b2cae71 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -25,6 +25,7 @@ jobs: branch: 'main' git_remote_url: 'ssh://dokku@v2.discours.io:22/authorizer' ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} + git_push_flags: '--force' - name: Push to dokku for dev branch if: steps.branch_name.outputs.branch == 'dev' @@ -32,4 +33,5 @@ jobs: with: branch: 'main' git_remote_url: 'ssh://dokku@staging.discours.io:22/authorizer' - ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} \ No newline at end of file + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} + git_push_flags: '--force' \ No newline at end of file From ca0118df5efdffbb0f2979e14d915537892bbf2b Mon Sep 17 00:00:00 2001 From: Stepan Vladovskiy Date: Thu, 11 Apr 2024 17:16:39 -0300 Subject: [PATCH 4/4] debug: no force in push to staging --- .gitea/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index be542a9..27205d2 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -32,5 +32,4 @@ jobs: with: branch: 'main' git_remote_url: 'ssh://dokku@staging.discours.io:22/authorizer' - ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} - git_push_flags: '--force' \ No newline at end of file + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} \ No newline at end of file