Skip to content

Commit

Permalink
docs: add makefile target
Browse files Browse the repository at this point in the history
  • Loading branch information
nwagner84 committed Feb 24, 2024
1 parent 2c63f5a commit 1575d9a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,9 @@ jobs:
hugo --minify
gh-pages:
if: ${{ github.ref == 'refs/heads/main' }}
# if: ${{ github.ref == 'refs/heads/main' }}
needs:
- audit
# - audit
- book
- careful
- check
Expand All @@ -354,7 +354,7 @@ jobs:
- miri
- test
# - udeps
- upgrades
# - upgrades
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -375,11 +375,7 @@ jobs:
hugo-version: 'latest'
extended: true
- run: |
mkdir -p target/docs
cargo doc --all --no-deps --workspace --target-dir target/docs/api
hugo --minify --gc --source docs --destination ../target/docs/book
echo '<meta http-equiv="refresh" content="0; url=doc/pica/index.html"><a href=doc/pica/index.html">Redirect</a>' >> target/docs/api/index.html
echo '<meta http-equiv="refresh" content="0; url=book/index.html"><a href=book/index.html">Redirect</a>' >> target/docs/index.html
make docs
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ MAKEFLAGS += -rR

DESTDIR=
CARGO ?= cargo
HUGO ?= hugo
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin

Expand All @@ -29,6 +30,15 @@ fmt:
doc:
$(CARGO) doc --no-deps

docs:
mkdir -p target/docs
$(CARGO) doc --all --no-deps --workspace --target-dir target/docs/api
$(HUGO) --minify --gc --source docs --destination ../target/docs/book
echo '<meta http-equiv="refresh" content="0; url=doc/pica/index.html"><a href=doc/pica/index.html">Redirect</a>' \
> target/docs/api/index.html
echo '<meta http-equiv="refresh" content="0; url=book/index.html"><a href=book/index.html">Redirect</a>' \
> target/docs/index.html

release:
$(CARGO) build --workspace --all-features --release
$(CARGO) test --workspace --all-features --release
Expand All @@ -39,4 +49,4 @@ install: release
clean:
$(CARGO) clean

.PHONY: build clean check clippy test fmt doc release install
.PHONY: build clean check clippy test fmt doc docs release install

0 comments on commit 1575d9a

Please sign in to comment.