From e9712a951804f37de3e0e796f964efb928ae7c03 Mon Sep 17 00:00:00 2001 From: Jong Date: Sat, 6 Jul 2024 15:29:12 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=B0=B0=ED=8F=AC=20=EC=9B=8C=ED=81=AC?= =?UTF-8?q?=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EA=B3=A0=EB=8F=84=ED=99=94=20(#4?= =?UTF-8?q?0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-integration.yml | 38 ++++++++++++++++++++++++ .github/workflows/deploy-test.yml | 17 +++++------ 2 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/deploy-integration.yml diff --git a/.github/workflows/deploy-integration.yml b/.github/workflows/deploy-integration.yml new file mode 100644 index 00000000..4e9673cf --- /dev/null +++ b/.github/workflows/deploy-integration.yml @@ -0,0 +1,38 @@ +name: Push branch & deploy On remote repository only for Vercel + +on: + workflow_call: + inputs: + user_name: + description: 배포한 사용자 + required: true + type: string + stage: + description: 배포 유형(production,develop) + required: true + type: string + +jobs: + build: + runs-on: ubuntu-latest + container: pandoc/latex + steps: + - uses: actions/checkout@v4 + - name: Install mustache (to update the date) + run: apk add ruby && gem install mustache + - name: creates ouput + run: sh ./tools/build.sh + - name: Pushes to another repository + id: push_directory + uses: cpina/github-action-push-to-another-repository@main + env: + API_TOKEN_GITHUB: ${{ secrets.ACCESS_TOKEN }} + with: + source-directory: 'output' + destination-github-username: 'sambad-adventure' + destination-repository-name: 'deploy-sambad' + user-email: ${{secrets.EMAIL}} + commit-message: ${{github.event.commits[0].message}} + target-branch: ${{inputs.stage == 'prodction' && 'main' || 'develop' }} + - name: Test get variable exported by push-to-another-repository + run: echo $DESTINATION_CLONED_DIRECTORY diff --git a/.github/workflows/deploy-test.yml b/.github/workflows/deploy-test.yml index e0ebdfb0..8e370e3a 100644 --- a/.github/workflows/deploy-test.yml +++ b/.github/workflows/deploy-test.yml @@ -1,4 +1,4 @@ -name: Deploy Test?? +name: Deploy on: workflow_dispatch: @@ -13,12 +13,6 @@ on: options: - develop - production - workflow_call: - inputs: - user_name: - description: 배포한 사용자 - required: true - type: string run-name: '${{inputs.user_name}} runs workflow for ${{inputs.stage_choice}} deploy' @@ -33,6 +27,9 @@ jobs: - name: Get variables id: variables run: | - is_DEV=false - outputs: - stage: ${{env.stage}} + echo STAGE : ${{inputs.stage_choice}} + deploy: + uses: './.github/workflows/deploy-integration.yml' + with: + user_name: ${{inputs.user_name}} + stage: ${{inputs.stage_choice}}