-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: deploy docusaurus docs via GitHub Actions to Cloudflare (#1516)
* Testing the GitHub actions workflow instead of Vercel
- Loading branch information
Showing
3 changed files
with
86 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge. | ||
name: deploy-docusaurus-docs | ||
env: | ||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
DOCS_URL: ${{ vars.DOCS_URL }} | ||
DOCS_ALGOLIA_APP_ID: ${{ vars.DOCS_ALGOLIA_APP_ID }} | ||
DOCS_ALGOLIA_API_KEY: ${{ vars.DOCS_ALGOLIA_API_KEY }} | ||
DOCS_ALGOLIA_INDEX: ${{ vars.DOCS_ALGOLIA_INDEX }} | ||
DOCS_SEGMENT_WRITE_KEY: ${{ vars.DOCS_SEGMENT_WRITE_KEY }} | ||
|
||
# Trigger the workflow when: | ||
on: | ||
# A push occurs to one of the matched branches. | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- apps/docs/** | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-deploy: | ||
# NOTE: This name appears in GitHub's Checks API. | ||
name: build-deploy | ||
environment: deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Set up Node.js 20 | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: "pnpm" | ||
node-version: "20.x" | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 9 | ||
run_install: | | ||
- recursive: true | ||
args: [--frozen-lockfile, --strict-peer-dependencies] | ||
- name: Build | ||
run: pnpm build:docs | ||
|
||
- name: Publish | ||
uses: cloudflare/wrangler-action@v3 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
workingDirectory: "apps/docs" | ||
command: pages deploy build --project-name=docs-opensource-observer |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.