Skip to content

Commit 0228108

Browse files
authored
ops(docs-release): trigger docs release after binary release (#609)
1 parent b4b578c commit 0228108

File tree

4 files changed

+41
-46
lines changed

4 files changed

+41
-46
lines changed

.github/workflows/_doc_release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release Docs
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
environment: docs-release
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: 18
15+
cache: yarn
16+
cache-dependency-path: docs/yarn.lock
17+
- uses: webfactory/[email protected]
18+
with:
19+
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
20+
- name: Deploy to GitHub Pages
21+
env:
22+
USE_SSH: true
23+
run: |
24+
export COCOINDEX_DOCS_POSTHOG_API_KEY=${{ vars.COCOINDEX_DOCS_POSTHOG_API_KEY }}
25+
export COCOINDEX_DOCS_MIXPANEL_API_KEY=${{ vars.COCOINDEX_DOCS_MIXPANEL_API_KEY }}
26+
export COCOINDEX_DOCS_ALGOLIA_APP_ID=${{ vars.COCOINDEX_DOCS_ALGOLIA_APP_ID }}
27+
export COCOINDEX_DOCS_ALGOLIA_API_KEY=${{ vars.COCOINDEX_DOCS_ALGOLIA_API_KEY }}
28+
git config --global user.email "${{ vars.COCOINDEX_DOCS_DEPLOY_USER_EMAIL }}"
29+
git config --global user.name "${{ vars.COCOINDEX_DOCS_DEPLOY_USER_NAME }}"
30+
yarn --cwd docs install --frozen-lockfile
31+
yarn --cwd docs deploy

.github/workflows/docs.yml

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@ on:
66
paths:
77
- docs/**
88
- ".github/workflows/docs.yml"
9-
push:
10-
branches: [main]
11-
paths:
12-
- docs/**
13-
- ".github/workflows/docs.yml"
149
workflow_dispatch:
1510

1611
permissions:
1712
contents: write
1813

1914
jobs:
2015
test-deploy:
21-
if: github.event_name != 'push'
16+
if: github.event_name == 'pull_request'
2217
runs-on: ubuntu-latest
2318
steps:
2419
- uses: actions/checkout@v4
@@ -32,43 +27,7 @@ jobs:
3227
- name: Test build website
3328
run: yarn --cwd docs build
3429

35-
deploy-precheck:
36-
if: ${{ github.event_name != 'pull_request' }}
37-
runs-on: ubuntu-latest
38-
environment: docs-release
39-
outputs:
40-
gh-deploy-key: ${{ steps.gh-deploy-key.outputs.defined }}
41-
steps:
42-
- id: gh-deploy-key
43-
env:
44-
GH_PAGES_DEPLOY: ${{ secrets.GH_PAGES_DEPLOY }}
45-
if: "${{ env.GH_PAGES_DEPLOY != '' }}"
46-
run: echo "defined=true" >> $GITHUB_OUTPUT
47-
4830
deploy:
49-
needs: [deploy-precheck]
50-
if: ${{ needs.deploy-precheck.outputs.gh-deploy-key == 'true' }}
51-
runs-on: ubuntu-latest
52-
environment: docs-release
53-
steps:
54-
- uses: actions/checkout@v4
55-
- uses: actions/setup-node@v4
56-
with:
57-
node-version: 18
58-
cache: yarn
59-
cache-dependency-path: docs/yarn.lock
60-
- uses: webfactory/[email protected]
61-
with:
62-
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
63-
- name: Deploy to GitHub Pages
64-
env:
65-
USE_SSH: true
66-
run: |
67-
export COCOINDEX_DOCS_POSTHOG_API_KEY=${{ vars.COCOINDEX_DOCS_POSTHOG_API_KEY }}
68-
export COCOINDEX_DOCS_MIXPANEL_API_KEY=${{ vars.COCOINDEX_DOCS_MIXPANEL_API_KEY }}
69-
export COCOINDEX_DOCS_ALGOLIA_APP_ID=${{ vars.COCOINDEX_DOCS_ALGOLIA_APP_ID }}
70-
export COCOINDEX_DOCS_ALGOLIA_API_KEY=${{ vars.COCOINDEX_DOCS_ALGOLIA_API_KEY }}
71-
git config --global user.email "${{ vars.COCOINDEX_DOCS_DEPLOY_USER_EMAIL }}"
72-
git config --global user.name "${{ vars.COCOINDEX_DOCS_DEPLOY_USER_NAME }}"
73-
yarn --cwd docs install --frozen-lockfile
74-
yarn --cwd docs deploy
31+
name: Release Docs
32+
if: ${{ github.event_name == 'workflow_dispatch' }}
33+
uses: ./.github/workflows/_doc_release.yml

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,8 @@ jobs:
107107
with:
108108
command: upload
109109
args: --non-interactive --skip-existing wheels-*/*
110+
111+
release-docs:
112+
name: Release Docs
113+
needs: [release]
114+
uses: ./.github/workflows/_doc_release.yml

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ __pycache__/
99
*.so
1010

1111
# Distribution / packaging
12-
.venv/
12+
.venv*/
1313
dist/
1414

1515
.DS_Store

0 commit comments

Comments
 (0)