Skip to content

Commit fcdd933

Browse files
Build and deploy docs to Github pages (#35)
* Added Github action for building and publishing docs * Create index redirect page for docs * Only deploy on master, fixed redirect
1 parent 042c70a commit fcdd933

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.github/workflows/docs.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy documentation
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
docs:
9+
name: Build and Deploy
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
rust-toolchain:
14+
- nightly
15+
php:
16+
- '8.0'
17+
llvm:
18+
- '11.0'
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php }}
26+
- name: Setup Rust
27+
uses: actions-rs/toolchain@v1
28+
with:
29+
toolchain: ${{ matrix.rust-toolchain }}
30+
- name: Setup LLVM & Clang
31+
uses: KyleMayes/install-llvm-action@v1
32+
with:
33+
version: ${{ matrix.llvm }}
34+
directory: ${{ runner.temp }}/llvm-${{ matrix.llvm }}
35+
- name: Build docs
36+
uses: actions-rs/cargo@v1
37+
env:
38+
LIBCLANG_PATH: ${{ runner.temp }}/llvm-${{ matrix.llvm }}/lib
39+
with:
40+
command: doc
41+
args: --release
42+
- name: Create index redirect
43+
run: |
44+
echo '<meta http-equiv=refresh content=0;url=/ext-php-rs/ext_php_rs>' > target/doc/index.html
45+
- name: Publish docs
46+
uses: JamesIves/[email protected]
47+
with:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
BRANCH: gh-pages
50+
FOLDER: target/doc
51+
CLEAN: true

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ Bindings for the Zend API to build PHP extensions natively in Rust. Inspired by
44

55
[![PHP Discorders](https://discord.com/api/guilds/115233111977099271/widget.png?style=banner1)](https://discord.gg/dphp)
66

7+
## Documentation
8+
9+
We are currently unable to deploy our documentation to `docs.rs` due to the crate requiring PHP 8.0, which is unavailable in the default Ubuntu repositories.
10+
Documentation can be viewed [here](https://davidcole1340.github.io/ext-php-rs/). It is generated from the latest `master` branch. Documentation will be moved to `docs.rs` when Ubuntu updates its repositories
11+
to PHP 8.0.
12+
713
## Features
814

915
This is not a set feature list, but these are the features on my roadmap. Create an issue if there's something you'd like to see!

0 commit comments

Comments
 (0)