-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -54,33 +47,28 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout `docs` repository | ||
- name: "Checkout `docs` repository" | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: versotile-org/docs.versotile.org | ||
repository: versotile-org/www-docs | ||
ssh-key: ${{ secrets.DOCS_DEPLOY_KEY }} | ||
ref: docs | ||
|
||
- name: Clean up docs directory | ||
run: | | ||
cp {docs/,}index.html | ||
rm -r docs/* | ||
mv index.html docs/ | ||
cp CNAME docs/ | ||
- name: Download `doc` | ||
- name: "Download `doc` artifact" | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: doc | ||
path: docs | ||
path: artifact | ||
|
||
- name: Configure Git | ||
- 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' | ||
- name: Commit and push | ||
run: | | ||
git add docs | ||
git commit -m ":rocket: update docs from \`verso\` repository" | ||
rm -r docs/* | ||
cp -r artifact/* docs/ | ||
git add docs/ | ||
git fetch origin main:main | ||
git checkout main docs/ | ||
git status | ||
git commit -m ":rocket: update docs from \`verso\` repository" || exit 0 | ||
git push origin docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters