Skip to content

Commit 4aa94a5

Browse files
committed
Chore: ci-cd.yml 수정 - Decide tag 스텝 추가
1 parent 97fab40 commit 4aa94a5

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/ci-cd.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,21 @@ jobs:
9393
deploy:
9494
needs: build-and-push
9595
# dev에 머지 전 cd 대상 브랜치 중첩 적용 (release, dev)
96-
if: github.event_name == 'push' && (github.ref == 'refs/heads/release' || github.ref == 'refs/heads/dev') && needs.build-and-push.result == 'success'
96+
if: github.event_name == 'push' && (github.ref == 'refs/heads/release' || github.ref == 'refs/heads/dev') &&
97+
(needs.build-and-push.result == 'success')
98+
|| (github.event_name == 'workflow_dispatch')
9799
runs-on: ubuntu-latest
100+
98101
steps:
102+
- name: Decide tag
103+
id: tag
104+
run: |
105+
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.tag }}" ]; then
106+
echo "value=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
107+
else
108+
echo "value=release" >> $GITHUB_OUTPUT
109+
fi
110+
99111
- name: Deploy
100112
uses: appleboy/ssh-action@v1.0.3
101113
with:
@@ -104,5 +116,5 @@ jobs:
104116
key: ${{ secrets.CD_SSH_KEY }}
105117
port: ${{ secrets.CD_PORT }}
106118
script: |
107-
export DEPLOY_TAG=release
119+
export DEPLOY_TAG='${{ steps.tag.outputs.value }}'
108120
bash -lc '/srv/docsa/infra/deploy.sh'

0 commit comments

Comments
 (0)