Skip to content

Commit b1f168f

Browse files
committed
Add asf-staged for deployment preview
1 parent cfda795 commit b1f168f

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

.github/workflows/publish-cloudberry-site.yml

+22-5
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,28 @@ jobs:
5252
- uses: actions/setup-node@v4
5353
with:
5454
node-version: 20
55-
- run: npm install
56-
- run: npm run build
57-
- run: cp .asf.yaml build/.asf.yaml
58-
- uses: peaceiris/actions-gh-pages@v3
59-
if: github.event_name != 'pull_request'
55+
56+
# Install dependencies and build site
57+
- name: Install dependencies
58+
run: npm install
59+
- name: Build site
60+
run: npm run build
61+
- name: Copy ASF config
62+
run: cp .asf.yaml build/.asf.yaml
63+
64+
# Deploy to asf-staging for PR preview
65+
- name: Deploy to staging
66+
if: github.event_name == 'pull_request'
67+
uses: peaceiris/actions-gh-pages@v4
68+
with:
69+
github_token: ${{ secrets.GITHUB_TOKEN }}
70+
publish_dir: ./build
71+
publish_branch: asf-staging
72+
73+
# Deploy to asf-site for production
74+
- name: Deploy to production
75+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
76+
uses: peaceiris/actions-gh-pages@v4
6077
with:
6178
github_token: ${{ secrets.GITHUB_TOKEN }}
6279
publish_dir: ./build

0 commit comments

Comments
 (0)