Skip to content

Commit f66f750

Browse files
committed
GitHub pages actions for docs
1 parent df5b730 commit f66f750

File tree

8 files changed

+74
-14
lines changed

8 files changed

+74
-14
lines changed

.github/workflows/ci.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
uses: ./.github/workflows/jobs/build.yaml
11+
test:
12+
uses: ./.github/workflows/jobs/test.yaml
13+
format:
14+
uses: ./.github/workflows/jobs/format.yaml

.github/workflows/deploy-docs.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
10+
jobs:
11+
build:
12+
uses: ./.github/workflows/jobs/build-docs.yaml
13+
deploy:
14+
needs: build
15+
uses: ./.github/workflows/jobs/deploy-pages.yaml
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build Docs
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
13+
- name: Setup Rust toolchain
14+
uses: actions-rust-lang/setup-rust-toolchain@v1
15+
16+
- name: Build docs
17+
run: cargo run --bin docapella -- build
18+
working-directory: ./docs
19+
20+
- name: Upload artifact
21+
uses: actions/upload-pages-artifact@v3
22+
with:
23+
path: ./docs/_build
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Deploy to Pages
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
deploy:
8+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
9+
permissions:
10+
pages: write # to deploy to Pages
11+
id-token: write # to verify the deployment originates from an appropriate source
12+
13+
# Deploy to the github-pages environment
14+
environment:
15+
name: github-pages
16+
url: ${{ steps.deployment.outputs.page_url }}
17+
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Deploy to GitHub Pages
21+
id: deployment
22+
uses: actions/deploy-pages@v4

.github/workflows/on_push.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)