Skip to content

Commit 67cd712

Browse files
committed
chore: wip
1 parent 7da3d5f commit 67cd712

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ jobs:
130130
run: bun test
131131

132132
release-check:
133+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
133134
runs-on: ubuntu-latest
134135

135136
outputs:
@@ -141,12 +142,15 @@ jobs:
141142
- name: Release Check
142143
id: check_release
143144
run: |
144-
echo "CONTAINS_RELEASE=$(git log --format=%B -n 1 ${{ github.event.after }} | grep -ci 'release')" >> $GITHUB_ENV
145-
echo "contains_release=${{ env.CONTAINS_RELEASE }}" >> $GITHUB_OUTPUT
145+
if git log --format=%B -n 1 "${{ github.event.after }}" | grep -qi 'release'; then
146+
echo "contains_release=1" >> "$GITHUB_OUTPUT"
147+
else
148+
echo "contains_release=0" >> "$GITHUB_OUTPUT"
149+
fi
146150
147151
deploy-prod:
148-
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && needs.check_commit_message.outputs.contains_release == '0'
149-
needs: [lint, typecheck, test]
152+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.release-check.outputs.contains_release == '0'
153+
needs: [lint, typecheck, test, release-check]
150154
runs-on: ubuntu-latest
151155
environment: production
152156

@@ -180,8 +184,8 @@ jobs:
180184
run: bun buddy deploy production
181185

182186
deploy-stage:
183-
if: (github.ref == 'refs/heads/main' && github.event_name == 'push') || (startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-beta.'))
184-
needs: [lint, typecheck, test, deploy-prod, deploy-dev]
187+
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-beta.'))
188+
needs: [lint, typecheck, test]
185189
runs-on: ubuntu-latest
186190
environment: staging
187191

@@ -204,8 +208,8 @@ jobs:
204208
run: bun install
205209

206210
deploy-dev:
207-
if: (github.ref == 'refs/heads/main' && github.event_name == 'push') || (github.event_name == 'pull_request' && github.base_ref == 'main')
208-
needs: [lint, typecheck, test, deploy-prod]
211+
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request' && github.base_ref == 'main')
212+
needs: [lint, typecheck, test]
209213
runs-on: ubuntu-latest
210214
environment: development
211215

0 commit comments

Comments
 (0)