Skip to content
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

gh-pages: stop building guide for main #2599

Merged
merged 1 commit into from Aug 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 1 addition & 36 deletions .github/workflows/gh-pages.yml
Expand Up @@ -39,13 +39,6 @@ jobs:
TAG_NAME="${GITHUB_REF##*/}"
echo "::set-output name=tag_name::${TAG_NAME}"

# Build some internal docs and inject a banner on top of it.
- name: Build the internal docs
run: cargo xtask doc --internal
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that building docs is tested by the Netlify build, which does report if it fails. We could consider making a test-docs-build CI job just to make it simpler to see if docs build succeeded/failed.


- name: Clear the extra artefacts created earlier
run: rm -rf target

# This builds the book in target/guide.
- name: Build the guide
run: |
Expand All @@ -54,43 +47,15 @@ jobs:
env:
PYO3_VERSION_TAG: ${{ steps.prepare_tag.outputs.tag_name }}

# This adds the docs to target/guide/doc
- name: Build the doc
run: |
cargo xtask doc
mv target/doc target/guide/doc
echo "<meta http-equiv=refresh content=0;url=pyo3/index.html>" > target/guide/doc/index.html

- name: Deploy docs and the guide
if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'release' }}
if: ${{ github.event_name == 'release' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/guide/
destination_dir: ${{ steps.prepare_tag.outputs.tag_name }}
full_commit_message: "Upload documentation for ${{ steps.prepare_tag.outputs.tag_name }}"

guide-release:
needs: guide-build
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
steps:
- name: Create latest tag redirects
env:
TAG_NAME: ${{ needs.build.outputs.tag_name }}
run: |
mkdir public
echo "<meta http-equiv=refresh content=0;url='$TAG_NAME/'>" > public/index.html
ln -sfT $TAG_NAME public/latest

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public/
full_commit_message: "Release ${{ needs.build.outputs.tag_name }}"
keep_files: true

cargo-benchmark:
if: ${{ github.ref_name == 'main' }}
name: Cargo benchmark
Expand Down