Skip to content

Commit

Permalink
fix doc build error
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikopet committed Sep 24, 2024
1 parent e047993 commit 9aa47aa
Showing 1 changed file with 25 additions and 32 deletions.
57 changes: 25 additions & 32 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,35 @@ on:

jobs:
build:
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: sccache
CCACHE: sccache
SCCACHE_GHA_ENABLED: 'true'
LIBCLANG_PATH: /usr/lib/llvm-14/lib
runs-on: ubuntu-24.04
permissions:
actions: write # for purging
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Run sccache-cache
uses: Mozilla-Actions/[email protected]
- uses: actions/checkout@v4
- uses: nixbuild/nix-quick-install-action@v28

- name: Configure cache
uses: Swatinem/rust-cache@v2

- name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Setup Nix Shell
uses: rrbutani/use-nix-shell-action@v1
- name: "Restore and cache Nix store"
uses: nix-community/cache-nix-action@v5
with:
file: shell.nix
paths: |
~/.cargo
target/debug/
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', 'Cargo.lock', 'Cargo.toml') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
gc-max-store-size-linux: 1073741824

- name: Clean docs folder
run: cargo clean --doc
- name: "Add Nix channel"
run: |
nix-channel --add https://nixos.org/channels/nixos-24.05 nixpkgs
nix-channel --update nixpkgs
- name: Build docs
run: cargo doc -p verso --no-deps
- name: "Build Verso docs"
run: nix-shell shell.nix --run 'cargo doc -p verso --no-deps'

- name: Remove lock file
- name: "Remove doc lock file"
run: rm target/doc/.lock

- name: Upload `doc`
- name: "Upload `doc` artifact"
uses: actions/upload-artifact@v4
with:
name: doc
Expand All @@ -54,20 +47,20 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout `docs` repository
- name: "Checkout `docs` repository"
uses: actions/checkout@v4
with:
repository: versotile-org/www-docs
ssh-key: ${{ secrets.DOCS_DEPLOY_KEY }}
ref: docs

- name: Download `doc`
- name: "Download `doc` artifact"
uses: actions/download-artifact@v4
with:
name: doc
path: artifact

- name: Configure git, commit changes and PUSH
- name: "Configure git, commit changes and PUSH"
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
Expand All @@ -77,5 +70,5 @@ jobs:
git fetch origin main:main
git checkout main docs/
git status
git commit -m ":rocket: update docs from \`verso\` repository"
git commit -m ":rocket: update docs from \`verso\` repository" || exit 0
git push origin docs

0 comments on commit 9aa47aa

Please sign in to comment.