Skip to content

Commit 605eeac

Browse files
committed
Make CI build & deploy for manual workflow dispatch too
1 parent c451147 commit 605eeac

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ jobs:
1515
# Install & build & test:
1616
- run: npm ci
1717

18-
# Build without secrets for previews, in non-push cases:
18+
# Build without secrets for previews, in non-main cases:
1919
- name: Build for preview
20-
if: github.event_name != 'push'
20+
if: github.ref != 'refs/heads/main'
2121
run: npm run build
2222
env:
2323
NODE_ENV: development
2424
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2525

26-
# Build with secrets for production, on push only:
26+
# Build with secrets for production, on main only:
2727
- name: Build for production
28-
if: github.event_name == 'push'
28+
if: github.ref == 'refs/heads/main'
2929
run: npm run build
3030
env:
3131
NODE_ENV: production
@@ -46,7 +46,7 @@ jobs:
4646

4747
check-blog-changes:
4848
name: Check for new blog posts to announce
49-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
49+
if: github.ref == 'refs/heads/main'
5050
runs-on: ubuntu-latest
5151
needs: build
5252
outputs:
@@ -93,7 +93,7 @@ jobs:
9393
9494
publish-docker:
9595
name: Build & publish container to Docker Hub
96-
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/dependabot/')
96+
if: github.ref == 'refs/heads/main' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/dependabot/'))
9797
runs-on: ubuntu-latest
9898
needs: build
9999
steps:
@@ -167,7 +167,7 @@ jobs:
167167

168168
announce-blog-changes:
169169
name: Announce new blog posts
170-
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.check-blog-changes.outputs.new-blog-post != ''
170+
if: github.ref == 'refs/heads/main' && needs.check-blog-changes.outputs.new-blog-post != ''
171171
runs-on: ubuntu-latest
172172
needs:
173173
- check-blog-changes

0 commit comments

Comments
 (0)