Skip to content

Commit

Permalink
feat: 배포 워크플로우 고도화 (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrevile authored Jul 6, 2024
1 parent faa3ef9 commit e9712a9
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 10 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/deploy-integration.yml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 7 additions & 10 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Test??
name: Deploy

on:
workflow_dispatch:
Expand All @@ -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'

Expand All @@ -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}}

0 comments on commit e9712a9

Please sign in to comment.