Skip to content

Commit

Permalink
change main CI to upload tard build of book as new release
Browse files Browse the repository at this point in the history
  • Loading branch information
nick1udwig committed Aug 8, 2024
1 parent 9299c15 commit c2a5b8e
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/mdbook.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# Sample workflow for building and deploying a mdBook site to GitHub Pages
#
# To get started with mdBook see: https://rust-lang.github.io/mdBook/index.html
#
name: Deploy mdBook site to Pages
name: Deploy mdBook site to Pages and Create Release

on:
# Runs on pushes targeting the default branch
Expand All @@ -14,7 +10,7 @@ on:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
contents: write
pages: write
id-token: write

Expand All @@ -39,17 +35,37 @@ jobs:
cargo install --version ${MDBOOK_VERSION} mdbook
cargo install mdbook-linkcheck
cargo install mdbook-webinclude
cargo install mdbook-webinclude
cargo install --git https://github.com/nick1udwig/mdbook-hide-feature --locked
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Build with mdBook
run: mdbook build
- name: Upload artifact
- name: Upload artifact for deployment
uses: actions/upload-pages-artifact@v3
with:
path: ./book/html
- name: Archive built site
run: tar -czf book.tar.gz -C book/html .
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: Release ${{ github.run_number }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./book.tar.gz
asset_name: book.tar.gz
asset_content_type: application/gzip

# Deployment job
deploy:
Expand Down

0 comments on commit c2a5b8e

Please sign in to comment.