Skip to content

Commit 7cba482

Browse files
authored
chore: stage/prod 배포 및 승격 워크플로우를 web/admin 분리 운영으로 정비 (#438)
* chore: main-stage/release-prod 배포 워크플로우를 web/admin 공통으로 통합 * chore: 메인 preview 배포에 고정 stage 도메인 alias 단계 추가 * chore: stage 배포 워크플로우 제거 및 turbo 산출물 설정 정리
1 parent 5ab9b49 commit 7cba482

3 files changed

Lines changed: 69 additions & 252 deletions

File tree

.github/workflows/deploy-stage.yml

Lines changed: 0 additions & 212 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 68 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1-
name: Promote Main to Release
1+
name: Promote Main to Release Branches
22

33
permissions:
44
contents: write
55

66
on:
77
workflow_dispatch:
8+
inputs:
9+
target:
10+
description: "Promote target"
11+
required: true
12+
default: "both"
13+
type: choice
14+
options:
15+
- both
16+
- web
17+
- admin
818

919
jobs:
1020
generate_tag:
@@ -30,7 +40,7 @@ jobs:
3040
token: ${{ secrets.GITHUB_TOKEN }}
3141

3242
promote_release_branch:
33-
name: Promote main -> release
43+
name: Promote main -> release branch(es)
3444
runs-on: ubuntu-latest
3545
needs: create_release
3646
steps:
@@ -39,53 +49,72 @@ jobs:
3949
with:
4050
fetch-depth: 0
4151

42-
- name: Promote main branch to release branch
52+
- name: Promote main branch to selected release branch(es)
4353
run: |
4454
set -euo pipefail
4555
4656
git fetch origin main
47-
git fetch origin release || true
48-
4957
MAIN_SHA=$(git rev-parse origin/main)
5058
51-
if git show-ref --verify --quiet refs/remotes/origin/release; then
52-
RELEASE_SHA=$(git rev-parse origin/release)
53-
else
54-
RELEASE_SHA=""
55-
fi
59+
TARGET="${{ github.event.inputs.target }}"
5660
57-
if [ -z "$RELEASE_SHA" ]; then
58-
git push origin origin/main:refs/heads/release
59-
{
60-
echo "## Release Promotion"
61-
echo "- Status: success (release branch created)"
62-
echo "- Promoted main SHA: $MAIN_SHA"
63-
echo "- Target branch: release"
64-
echo "- Note: Vercel production deploy is triggered by release branch update"
65-
} >> "$GITHUB_STEP_SUMMARY"
66-
exit 0
67-
fi
61+
case "$TARGET" in
62+
web)
63+
RELEASE_BRANCHES="release-web"
64+
;;
65+
admin)
66+
RELEASE_BRANCHES="release-admin"
67+
;;
68+
both)
69+
RELEASE_BRANCHES="release-web release-admin"
70+
;;
71+
*)
72+
echo "Unsupported target: $TARGET" >&2
73+
exit 1
74+
;;
75+
esac
6876
69-
if [ "$MAIN_SHA" = "$RELEASE_SHA" ]; then
70-
{
71-
echo "## Release Promotion"
72-
echo "- Status: skipped (release is already up to date)"
73-
echo "- main: $MAIN_SHA"
74-
} >> "$GITHUB_STEP_SUMMARY"
75-
exit 0
76-
fi
77+
{
78+
echo "## Release Promotion"
79+
echo "- Selected target: $TARGET"
80+
echo "- Promoted main SHA: $MAIN_SHA"
81+
} >> "$GITHUB_STEP_SUMMARY"
7782
78-
if ! git merge-base --is-ancestor origin/release origin/main; then
79-
echo "release branch is not an ancestor of main. Resolve release history before promotion." >&2
80-
exit 1
81-
fi
83+
for BRANCH in $RELEASE_BRANCHES; do
84+
git fetch origin "$BRANCH" || true
8285
83-
git push origin origin/main:refs/heads/release
86+
if git show-ref --verify --quiet "refs/remotes/origin/$BRANCH"; then
87+
RELEASE_SHA=$(git rev-parse "origin/$BRANCH")
88+
else
89+
RELEASE_SHA=""
90+
fi
91+
92+
if [ -z "$RELEASE_SHA" ]; then
93+
git push origin origin/main:"refs/heads/$BRANCH"
94+
{
95+
echo "- $BRANCH: created from main"
96+
} >> "$GITHUB_STEP_SUMMARY"
97+
continue
98+
fi
99+
100+
if [ "$MAIN_SHA" = "$RELEASE_SHA" ]; then
101+
{
102+
echo "- $BRANCH: already up to date"
103+
} >> "$GITHUB_STEP_SUMMARY"
104+
continue
105+
fi
106+
107+
if ! git merge-base --is-ancestor "origin/$BRANCH" origin/main; then
108+
echo "$BRANCH is not an ancestor of main. Resolve release history before promotion." >&2
109+
exit 1
110+
fi
111+
112+
git push origin origin/main:"refs/heads/$BRANCH"
113+
{
114+
echo "- $BRANCH: updated"
115+
} >> "$GITHUB_STEP_SUMMARY"
116+
done
84117
85118
{
86-
echo "## Release Promotion"
87-
echo "- Status: success"
88-
echo "- Promoted main SHA: $MAIN_SHA"
89-
echo "- Target branch: release"
90-
echo "- Note: Vercel production deploy is triggered by release branch update"
119+
echo "- Note: Vercel production deploy is triggered by corresponding release branch update"
91120
} >> "$GITHUB_STEP_SUMMARY"

turbo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"tasks": {
55
"build": {
66
"dependsOn": ["^build"],
7-
"outputs": ["dist/**", ".output/**", ".vercel/output/**"],
7+
"outputs": ["dist/**", ".output/**"],
88
"env": ["NODE_ENV", "NEXT_PUBLIC_*"]
99
},
1010
"@solid-connect/web#build": {

0 commit comments

Comments
 (0)