Skip to content

Commit

Permalink
Deploy compiled book to GH Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Occhioverde committed Jul 31, 2024
1 parent 7ae0b55 commit 5d4b296
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Rust Book ITA Build"
name: "Rust Book ITA Build and Deploy"
on:
pull_request:
push:
Expand All @@ -11,20 +11,36 @@ jobs:
- name: Setup Nix
uses: nixbuild/nix-quick-install-action@v26
- name: Restore and cache Nix store
uses: nix-community/cache-nix-action@v4
uses: nix-community/cache-nix-action@v5
with:
key: cache-${{ matrix.os }}-${{ hashFiles('**/*.nix') }}-${{ hashFiles('**/*.lock', '**/Cargo.toml') }}
restore-keys: |
primary-key: cache-${{ matrix.os }}-${{ hashFiles('**/*.nix') }}-${{ hashFiles('**/*.lock', '**/Cargo.toml') }}
restore-prefixes-first-match: |
cache-${{ matrix.os }}-${{ hashFiles('**/*.nix') }}
cache-${{ matrix.os }}
- name: Build the Book
run: nix build
- name: Get the Book Artifacts
run: mkdir -p rust_book_ita && cp -r result/* rust_book_ita/
- name: Upload the Book Artifacts
uses: actions/upload-artifact@v3
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: rust_book_ita
path: rust_book_ita/
retention-days: 30
retention-days: 30
- name: Upload the Book for GH Pages
uses: actions/upload-pages-artifact@v3
with:
path: rust_book_ita/
Deploy:
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy Book to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 5d4b296

Please sign in to comment.