Skip to content

Commit f9f33d9

Browse files
authored
chore(ci): deploy sdk docs after production release (#439)
* chore(ci): deploy sdk docs after production release * chore(ci): fix conditional and prepare vercel.json
1 parent 783b2f9 commit f9f33d9

File tree

4 files changed

+52
-16
lines changed

4 files changed

+52
-16
lines changed

.github/workflows/release-notes.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,3 @@ jobs:
3333
text:
3434
type: mrkdwn
3535
text: ${{toJson(steps.releasemarkdown.outputs.text)}}
36-
mark-issues-as-done:
37-
runs-on: ubuntu-latest
38-
steps:
39-
- name: Checkout
40-
id: checkout
41-
uses: actions/checkout@v4
42-
43-
- name: Mark SDK issues as done
44-
uses: sanity-io/mark-issues-done-action@main
45-
with:
46-
linear_api_key: ${{secrets.LINEAR_API_TOKEN}}
47-
repository_name: ${{github.event.repository.name}}
48-
# Label: In Staging
49-
initial_state_id: "c56956cd-c281-4ca5-889f-6189ce231a6d"
50-
# Label: Shipped
51-
done_state_id: "5a35b7bf-6d37-4cc2-854a-2f18d160e2e5"

.github/workflows/release-please.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: Release Please
2+
env:
3+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
4+
VERCEL_PROJECT_ID: ${{ secrets.DOCS_VERCEL_PRODUCTION_PROJECT_ID }}
25

36
on:
47
push:
@@ -17,6 +20,8 @@ permissions:
1720

1821
jobs:
1922
release-please:
23+
outputs:
24+
command: ${{ steps.release.outputs.releases_created == 'true' || github.event.inputs.publish == 'true' }}
2025
permissions:
2126
contents: read # for checkout
2227
id-token: write # to enable use of OIDC for npm provenance
@@ -58,3 +63,31 @@ jobs:
5863
# need to publish all unpublished versions to NPM here
5964
- run: pnpm -r publish
6065
if: ${{ steps.release.outputs.releases_created == 'true' || github.event.inputs.publish == 'true' }}
66+
67+
post-release-steps:
68+
runs-on: ubuntu-latest
69+
needs: release-please
70+
if: ${{ needs.release-please.outputs.command == true }}
71+
steps:
72+
- name: Checkout
73+
uses: actions/checkout@v4
74+
75+
- name: Install Vercel CLI
76+
run: pnpm install --global vercel@latest
77+
78+
- name: Prepare vercel.json
79+
run: pnpm docs:prepare
80+
81+
- name: Deploy Docs to Vercel
82+
run: vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }}
83+
84+
- name: Mark SDK issues as done
85+
uses: sanity-io/mark-issues-done-action@main
86+
if: ${{ steps.release.outputs.releases_created == 'true' || github.event.inputs.publish == 'true' }}
87+
with:
88+
linear_api_key: ${{secrets.LINEAR_API_TOKEN}}
89+
repository_name: ${{github.event.repository.name}}
90+
# Label: In Staging
91+
initial_state_id: "c56956cd-c281-4ca5-889f-6189ce231a6d"
92+
# Label: Shipped
93+
done_state_id: "5a35b7bf-6d37-4cc2-854a-2f18d160e2e5"

docs-vercel.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"rewrites": [
3+
{
4+
"source": "/favicon.ico",
5+
"destination": "/favicon.ico"
6+
},
7+
{
8+
"source": "/(.*)",
9+
"destination": "/index.html"
10+
}
11+
],
12+
"trailingSlash": false,
13+
"git": {
14+
"deploymentEnabled": {
15+
"main": false
16+
}
17+
}
18+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"clean:deps": "rimraf packages/*/node_modules apps/*/node_modules node_modules",
2828
"dev": "pnpm dev:kitchensink",
2929
"dev:kitchensink": "turbo run dev --filter=@sanity/kitchensink-react",
30+
"docs:prepare": "rm vercel.json && cp docs-vercel.json vercel.json",
3031
"format": "prettier --write --cache --ignore-unknown .",
3132
"lint": "turbo run lint -- --fix && eslint . --fix",
3233
"prepare": "husky",

0 commit comments

Comments
 (0)