-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: github action to integrate/publish endo and agoric-sdk reference docs too #1038
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
649e426
feat: github action to integrate/publish endo reference doc too
LuqiPan e806103
feat: refine build steps and add steps to build agoric-sdk docs
LuqiPan 9544c91
Merge branch 'main' into 927-reference-docs-in-search
LuqiPan 3da9eca
debug: add `yarn build` like Dan suggested
LuqiPan 162d794
chore: bump vitepress to 1.0.1
LuqiPan 293db4e
debug: add a DEBUG flag to "docs:build-cf" script
LuqiPan 9c85876
chore: update ignoreDeadLinks list
LuqiPan deb67f6
ci: update yarn commands to generate markdown files
LuqiPan 56a16bb
ci: update github workflow to reflect upstream changes
LuqiPan 50f3e25
ci: use cloudflare/pages-action instead and add a step to comment URL
LuqiPan b16111d
ci: switch back to using wrangler-action and use its output
LuqiPan f64b764
ci: add a condition to check if event is pull request
LuqiPan 40d3697
ci: add conditions for preview and production deployments separately
LuqiPan 059336b
comment: add some background in comments for build-deploy-doc workflow
LuqiPan 2885469
chore: add endo and agoric-sdk to submodules
LuqiPan a1e4a9b
ci: disable github workflow for now
LuqiPan 2f3993b
chore: bump node version to 18.18.0
LuqiPan 9cdca18
ci: add several yarn targets to build .md docs for endo and agoric-sdk
LuqiPan 57ac64e
chore: update submodules
LuqiPan b7ca228
chore: add a yarn target for `git:update-submodules`
LuqiPan 891494f
debug: undo `yarn install` by cloudflare to build
LuqiPan a4284c5
debug: update file paths when `mv`ing
LuqiPan c813781
chore: add a comment for docs:build-cf script
LuqiPan ba4232f
chore: add a yarn script for git-submodule:init
LuqiPan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,86 @@ | ||
# Based on example at: https://github.com/marketplace/actions/deploy-to-github-pages | ||
|
||
name: Build and Deploy documentation site | ||
|
||
# This workflow is a customized workflow to deploy docs site to Cloudflare | ||
# The reason we can no longer use Cloudflare's git integration to deploy docs | ||
# site anymore is that Cloudflare's git integration would only check out | ||
# documentation repo, whereas we need to check out both `endojs/endo` and | ||
# `agoric/agoric-sdk` repo to build the docs site. | ||
|
||
on: | ||
push: | ||
branches: | ||
# If it's a push to production branch, Cloudflare wrangler will deploy it as a | ||
# production deployment | ||
# The production branch for documentation project on Cloudflare is configured | ||
# to be `main` | ||
push: | ||
branches: | ||
- main | ||
# If it's a push to a non-production branch, Cloudflare wrangler will deploy | ||
# it as a preview deployment | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2.3.1 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Checkout Endo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: endojs/endo | ||
path: endo | ||
|
||
- name: Build Endo docs | ||
run: | | ||
cd endo | ||
yarn install | ||
yarn docs:markdown-for-agoric-documentation-repo | ||
|
||
- name: Move Endo docs into main/reference | ||
run: mv endo/api-docs main/reference/endo | ||
|
||
- name: Checkout agoric-sdk | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
repository: agoric/agoric-sdk | ||
path: agoric-sdk | ||
|
||
- name: Install and Build | ||
- name: Build agoric-sdk docs | ||
run: | | ||
cd agoric-sdk | ||
yarn install | ||
yarn docs:build | ||
yarn build | ||
yarn docs:markdown-for-agoric-documentation-repo | ||
|
||
- name: Move agoric-sdk docs into main/reference | ||
run: mv agoric-sdk/api-docs main/reference/agoric-sdk | ||
|
||
- name: Configure SSH | ||
- name: Build Doc site | ||
run: | | ||
mkdir -m0700 -p ~/.ssh/ | ||
echo "$SSH_KEY" > ~/.ssh/staging.key | ||
chmod 600 ~/.ssh/staging.key | ||
cat >>~/.ssh/config <<END | ||
Host staging | ||
HostName $SSH_HOST | ||
User $SSH_USER | ||
IdentityFile ~/.ssh/staging.key | ||
StrictHostKeyChecking no | ||
Host staging2 | ||
HostName $SSH_HOST2 | ||
User $SSH_USER | ||
IdentityFile ~/.ssh/staging.key | ||
StrictHostKeyChecking no | ||
END | ||
env: | ||
SSH_USER: ${{ secrets.STAGING_SSH_USER }} | ||
SSH_KEY: ${{ secrets.STAGING_SSH_KEY }} | ||
SSH_HOST: ${{ secrets.STAGING_SSH_HOST }} | ||
SSH_HOST2: ${{ secrets.STAGING_SSH_HOST2 }} | ||
|
||
- name: SSH check out and build (staging) | ||
run: ssh staging 'cd documentation && git pull && yarn install --frozen-lockfile && yarn docs:build' | ||
|
||
- name: SSH check out and build (staging2) | ||
run: ssh staging2 'cd documentation && git pull && yarn install --frozen-lockfile && yarn docs:build' | ||
|
||
- name: Deploy to gh-pages | ||
uses: JamesIves/github-pages-deploy-action@3.7.1 | ||
yarn install | ||
yarn docs:build-cf | ||
|
||
- name: Publish to Cloudflare Pages | ||
id: publish-to-cloudflare-pages | ||
uses: cloudflare/wrangler-action@v3 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
# Cloudflare account ID is safe to be public | ||
# Ref: https://github.com/cloudflare/wrangler-legacy/issues/209#issuecomment-541654484 | ||
accountId: 0c4635effffcd7f36d1b9f0425a4367a | ||
command: pages deploy --project-name=documentation dist/ | ||
|
||
- name: Comment with preview URL | ||
if: github.event_name == 'pull_request' | ||
uses: actions/github-script@v7 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Provided by github: https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#about-the-github_token-secret | ||
BRANCH: gh-pages # The branch the action should deploy to. | ||
FOLDER: main/.vitepress/dist # The folder the action should deploy | ||
CLEAN: true # Automatically remove deleted files from the deploy branch | ||
script: | | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: 'Cloudflare Pages Preview URL: ${{ steps.publish-to-cloudflare-pages.outputs.deployment-url }}' | ||
}) | ||
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,6 @@ | ||
[submodule "agoric-sdk"] | ||
path = agoric-sdk | ||
url = https://github.com/Agoric/agoric-sdk | ||
[submodule "endo"] | ||
path = endo | ||
url = https://github.com/endojs/endo |
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 |
---|---|---|
@@ -1 +1 @@ | ||
v18.17.0 | ||
v18.18.0 |
Submodule agoric-sdk
added at
03b642
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 |
---|---|---|
|
@@ -83,6 +83,11 @@ export default defineConfig({ | |
ignoreDeadLinks: [ | ||
// ignore all localhost links | ||
/^https?:\/\/localhost/, | ||
// ignore links that starts with ./packages/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some of the |
||
/^.\/packages\/*/, | ||
'./MAINTAINERS', | ||
'./CONTRIBUTING', | ||
'./LICENSE', | ||
], | ||
sitemap: { | ||
hostname: 'https://docs.agoric.com', | ||
|
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a supported option to get a link based on a branch? one where the content is updated as commits are added to the branch, without changing the url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not with
wrangler-action
: https://github.com/cloudflare/wrangler-action/blob/fd98a7c99091f581101a9a9bc7300a005d2f63e7/action.yml#L48-L53Cloudflare Page bot is working again though so we retain the branch preview URL behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah. .DISABLED