Skip to content

Commit eb23d12

Browse files
authored
Trigger the docs deploy job only when GH_PAGES_DEPLOY secret is set. (#80)
This is to avoid a forked repo triggering this job which is deemed to fail.
1 parent cb7aff4 commit eb23d12

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: yarn build
3939

4040
deploy:
41-
if: github.event_name != 'pull_request'
41+
if: ${{ github.event_name != 'pull_request' && github.secrets.GH_PAGES_DEPLOY != '' }}
4242
runs-on: ubuntu-latest
4343
steps:
4444
- uses: actions/checkout@v4
@@ -56,13 +56,13 @@ jobs:
5656
cache: yarn
5757
- uses: webfactory/ssh-agent@v0.5.0
5858
with:
59-
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
59+
ssh-private-key: ${{ github.secrets.GH_PAGES_DEPLOY }}
6060
- name: Deploy to GitHub Pages
6161
env:
6262
USE_SSH: true
6363
run: |
64-
export COCOINDEX_DOCS_POSTHOG_API_KEY=${{ secrets.COCOINDEX_DOCS_POSTHOG_API_KEY }}
65-
export COCOINDEX_DOCS_MIXPANEL_API_KEY=${{ secrets.COCOINDEX_DOCS_MIXPANEL_API_KEY }}
64+
export COCOINDEX_DOCS_POSTHOG_API_KEY=${{ github.secrets.COCOINDEX_DOCS_POSTHOG_API_KEY }}
65+
export COCOINDEX_DOCS_MIXPANEL_API_KEY=${{ github.secrets.COCOINDEX_DOCS_MIXPANEL_API_KEY }}
6666
git config --global user.email "cocoindex.io@gmail.com"
6767
git config --global user.name "CocoIndex"
6868
yarn install --frozen-lockfile

0 commit comments

Comments
 (0)