Skip to content

Commit b896448

Browse files
committed
github: makes gh action more robust
1 parent 85631e1 commit b896448

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

.github/workflows/build-prod.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,28 @@ on:
66
- master
77

88
jobs:
9-
deploy:
10-
name: Build and Deploy
9+
build:
10+
name: Build Website
1111
runs-on: ubuntu-latest
1212
env:
13-
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
14-
ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME }}
15-
ALGOLIA_SEARCH_API_KEY: ${{ secrets.ALGOLIA_SEARCH_API_KEY }}
1613
NODE_OPTIONS: --max_old_space_size=8192
17-
permissions:
18-
contents: read
19-
deployments: write
2014
steps:
2115
- uses: actions/checkout@v4
2216
- uses: pnpm/action-setup@v4
2317
- name: Install dependencies
2418
run: pnpm install
2519
- name: Build website
26-
run: pnpm run build-prod
20+
run: |
21+
set -e
22+
pnpm run build-prod
23+
24+
deploy:
25+
name: Deploy to Cloudflare Pages
26+
runs-on: ubuntu-latest
27+
needs: build
28+
if: ${{ success() }}
29+
steps:
30+
- uses: actions/checkout@v4
2731
- name: Deploy to Cloudflare Pages
2832
uses: cloudflare/wrangler-action@v3
2933
with:

0 commit comments

Comments
 (0)