Skip to content

Commit 7eabc40

Browse files
committed
Deploy GitHub Pages using GitHub Action
1 parent ea5c96b commit 7eabc40

File tree

1 file changed

+45
-11
lines changed

1 file changed

+45
-11
lines changed

.github/workflows/gh-pages.yml

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,55 @@
1+
# Based on starter workflow
2+
# https://github.com/actions/starter-workflows/blob/8217436fdee2338da2d6fd02b7c9fcff634c40e7/pages/static.yml
3+
#
4+
# Simple workflow for deploying static content to GitHub Pages
15
name: "GitHub Pages"
26

37
on:
8+
# Runs on pushes targeting the default branch
49
push:
510
branches:
611
- master
712

13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
17+
permissions:
18+
contents: read
19+
pages: write
20+
id-token: write
21+
22+
# Allow one concurrent deployment
23+
concurrency:
24+
group: "pages"
25+
cancel-in-progress: true
26+
827
jobs:
9-
pages:
10-
runs-on: ubuntu-22.04
28+
# Single deploy job since we're just deploying
29+
deploy:
30+
environment:
31+
name: github-pages
32+
url: ${{ steps.deployment.outputs.page_url }}
33+
runs-on: ubuntu-latest
1134
steps:
12-
- uses: actions/checkout@v2
13-
- name: Generate code coverage
14-
run: |
15-
RUSTDOCFLAGS="--html-in-header ndarray-linalg/katex-header.html" cargo doc --no-deps
16-
mv target/doc public
17-
- name: Deploy GitHub Pages
18-
uses: peaceiris/actions-gh-pages@v3
35+
- name: Checkout
36+
uses: actions/checkout@v3
37+
38+
# Generate cargo-doc
39+
- uses: actions-rs/cargo@v1
1940
with:
20-
github_token: ${{ secrets.GITHUB_TOKEN }}
21-
publish_dir: ./public
41+
command: doc
42+
args: --no-deps
43+
44+
- name: Setup Pages
45+
uses: actions/configure-pages@v2
46+
47+
# Upload target/doc directory
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v1
50+
with:
51+
path: 'target/doc'
52+
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v1

0 commit comments

Comments
 (0)