Skip to content

Commit

Permalink
Merge pull request #2599 from davidhewitt/no-main-gh-pages
Browse files Browse the repository at this point in the history
gh-pages: stop building guide for main
  • Loading branch information
messense committed Aug 28, 2022
2 parents 9e9e913 + 3e15bb9 commit 511303a
Showing 1 changed file with 1 addition and 36 deletions.
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

- 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

0 comments on commit 511303a

Please sign in to comment.