From b8047bd50893dc295a66559aa270383fe931dc37 Mon Sep 17 00:00:00 2001 From: Kayoung Yoon Date: Thu, 25 Apr 2024 19:40:49 +0900 Subject: [PATCH 1/6] feat: added workflow for syncing branches --- .github/workflows/deploy-production.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index d5dc375..309a649 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -24,10 +24,21 @@ jobs: destination-repository-name: 'express-build' user-email: dev.kayoung@gmail.com target-branch: main -# deploy: -# name: deploy pm2 -# needs: git-push -# runs-on: [self-hosted, production] -# steps: -# - name: run shell script -# run: /home/ubuntu/deploy-piickle-server.sh + sync-branches: + runs-on: ubuntu-latest + name: Syncing develop branch with main + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Node + uses: actions/setup-node@v1 + with: + node-version: 12 + - name: Opening pull request + id: pull + uses: tretuna/sync-branches@1.4.0 + with: + GITHUB_TOKEN: ${{ secrets.TOKEN_FOR_PR }} + FROM_BRANCH: "main" + TO_BRANCH: "develop" + PULL_REQUEST_TITLE: "sync: main -> develop" From 80f996fc0f58d18247ac06860adf784feb6a0bce Mon Sep 17 00:00:00 2001 From: Kayoung Yoon Date: Thu, 25 Apr 2024 19:55:38 +0900 Subject: [PATCH 2/6] test: added temporary trigger --- .github/workflows/deploy-production.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 309a649..db87946 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -3,6 +3,9 @@ on: push: branches: - main + pull_request: + branches: + - main jobs: git-push: name: build and push From 54bb216dc85832e354a4a576a0de8d04381e78de Mon Sep 17 00:00:00 2001 From: Kayoung Yoon Date: Thu, 25 Apr 2024 19:59:28 +0900 Subject: [PATCH 3/6] Revert "test: added temporary trigger" This reverts commit 80f996fc0f58d18247ac06860adf784feb6a0bce. --- .github/workflows/deploy-production.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index db87946..309a649 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -3,9 +3,6 @@ on: push: branches: - main - pull_request: - branches: - - main jobs: git-push: name: build and push From 8e19980fe9a2ca5cb29bbc57b848a359888fb008 Mon Sep 17 00:00:00 2001 From: Kayoung Yoon Date: Thu, 25 Apr 2024 20:10:28 +0900 Subject: [PATCH 4/6] fix: title name template --- .github/workflows/deploy-production.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 309a649..8c7b089 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -3,6 +3,12 @@ on: push: branches: - main + pull_request: + branches: + - main +env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + jobs: git-push: name: build and push @@ -41,4 +47,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.TOKEN_FOR_PR }} FROM_BRANCH: "main" TO_BRANCH: "develop" - PULL_REQUEST_TITLE: "sync: main -> develop" + PULL_REQUEST_TITLE: "sync: $BRANCH_NAME -> main -> develop" From e7161f35435ce702193a9cfc189f67d53d0e970e Mon Sep 17 00:00:00 2001 From: Kayoung Yoon Date: Thu, 25 Apr 2024 20:15:34 +0900 Subject: [PATCH 5/6] fix: title name template --- .github/workflows/deploy-production.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 8c7b089..ec8dab1 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -6,8 +6,6 @@ on: pull_request: branches: - main -env: - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} jobs: git-push: @@ -47,4 +45,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.TOKEN_FOR_PR }} FROM_BRANCH: "main" TO_BRANCH: "develop" - PULL_REQUEST_TITLE: "sync: $BRANCH_NAME -> main -> develop" + PULL_REQUEST_TITLE: "sync: ${{ github.head_ref || github.ref_name }} -> main -> develop" From a49cf32055b86ecdfc12b4bd80ec6f9ff16f5858 Mon Sep 17 00:00:00 2001 From: Kayoung Yoon Date: Thu, 25 Apr 2024 20:23:07 +0900 Subject: [PATCH 6/6] revert: text trigger --- .github/workflows/build.yml | 4 ++-- .github/workflows/deploy-production.yml | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 23a23b5..bffe945 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: CI +name: Build on: pull_request jobs: build: @@ -11,4 +11,4 @@ jobs: cmd: install # will run `yarn install` command - uses: borales/actions-yarn@v3.0.0 with: - cmd: build # will run `yarn build` command \ No newline at end of file + cmd: build # will run `yarn build` command diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index ec8dab1..2063765 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -1,15 +1,11 @@ -name: build and push code +name: CI on: push: branches: - main - pull_request: - branches: - - main - jobs: git-push: - name: build and push + name: Build and push runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -29,8 +25,8 @@ jobs: user-email: dev.kayoung@gmail.com target-branch: main sync-branches: + name: Sync main -> develop runs-on: ubuntu-latest - name: Syncing develop branch with main steps: - name: Checkout uses: actions/checkout@v2