-
-
Notifications
You must be signed in to change notification settings - Fork 173
GitHub action to publish docs to GH Pages #1129
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
base: master
Are you sure you want to change the base?
Changes from 15 commits
2f000a4
5a85d8d
664d580
dbac6d3
fae5676
2d18a98
cb63d3a
03f7221
0dd9541
354e2b7
54cfd49
de8024e
16150cd
d2bb369
0006eb2
dff9e1f
9b8039d
45cd54a
2f85300
897b95e
b802387
bee2261
4bb846a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,36 @@ | ||||||||||||||||||||||||||||||||||||||||||||
name: Publish Docs | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
on: | ||||||||||||||||||||||||||||||||||||||||||||
push: | ||||||||||||||||||||||||||||||||||||||||||||
branches: [ master ] | ||||||||||||||||||||||||||||||||||||||||||||
paths: | ||||||||||||||||||||||||||||||||||||||||||||
- "docs/**" | ||||||||||||||||||||||||||||||||||||||||||||
- ".github/workflows/publish-docs.yml" | ||||||||||||||||||||||||||||||||||||||||||||
- "Makefile" | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
jobs: | ||||||||||||||||||||||||||||||||||||||||||||
publish: | ||||||||||||||||||||||||||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||||||||||||||||||
- uses: actions/checkout@v2 | ||||||||||||||||||||||||||||||||||||||||||||
- name: Build | ||||||||||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||||||||||
make st2 | ||||||||||||||||||||||||||||||||||||||||||||
sudo apt-get update | ||||||||||||||||||||||||||||||||||||||||||||
# python3-dev is already available | ||||||||||||||||||||||||||||||||||||||||||||
# sudo apt install python3-dev | ||||||||||||||||||||||||||||||||||||||||||||
sudo apt install libldap2-dev | ||||||||||||||||||||||||||||||||||||||||||||
sudo apt install libsasl2-dev | ||||||||||||||||||||||||||||||||||||||||||||
sudo pip3 install virtualenv | ||||||||||||||||||||||||||||||||||||||||||||
make docs | ||||||||||||||||||||||||||||||||||||||||||||
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. Good start, Per existing CircleCI config, there's also a need for additional routing logic depending on the branch: Lines 41 to 61 in 6c65852
From what I understand the logic looks this way:
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. this might be possible with the 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. so, the One difference, however, is that if we deploy to the root for the latest GA version like we do for S3, we'll lose all other subdirectories. For example, if we have To get around this, we could implement the action to deploy the latest GA release to a 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. actually, we have a bigger issue: When we push to github pages, a bot will run a This means that we cannot push to This will also impact us when we want to run a deployment to existing version branches as we'd have to wait until each is finished before triggering the next one.. One thing that might help is that we could utilize the concurrency feature for our workflow. This will help ensure that our workflows don't run while another of our workflows are running, but we don't seem to have control over the Using However, it also means that we have to run two builds for the same thing... One possible workaround is to use routing logic in Route53 or cloudfront to point the latest GA release instead of using a
alternatively, it might be possible in the future to publish to GH Pages without the bot, but for now, that's our only option, I think: 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. example pipeline here: https://github.com/mickmcgrath13/st2docs/actions/runs/2531438591 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. I don't think I understand the issue. The So, if we have two merges into the gh-pages branch at about the same time, and two builds start, then the build for the older commit should be canceled. But, because the newer commit should include everything from the previous commit, I don't think that's a problem. What else am I missing here? 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. i think the issue was that if we are deploying say to version 3.7 of the docs, and then do a deploy to latest whilst its still running the deploy for v3.7. The v3.7 one will be cancelled, and we won't get the update to v3.7. 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. By the time 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. from my previous notes:
One thing that can possibly work around these issues is to always only build gh pages in a pipeline based on the base branch. the base branch gh-pages pipeline will also then we have pipelines for version-specific branches that just trigger the base gh-pages pipeline to rebuild everything an all-in-one pipeline at the base branch that builds root and subdirectories would also mitigate special routing requirements (i.e. we just build all the subdirectories we need) just some thoughts.. |
||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
# turn off jekyll so that url routing works properly with underscores | ||||||||||||||||||||||||||||||||||||||||||||
touch docs/build/html/.nojekyll | ||||||||||||||||||||||||||||||||||||||||||||
- name: Deploy to GitHub Pages | ||||||||||||||||||||||||||||||||||||||||||||
uses: crazy-max/ghaction-github-pages@v3 | ||||||||||||||||||||||||||||||||||||||||||||
mickmcgrath13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||||||||
target_branch: gh-pages | ||||||||||||||||||||||||||||||||||||||||||||
build_dir: docs/build/html | ||||||||||||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||||||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Uh oh!
There was an error while loading. Please reload this page.