2021-05-04 01:42:52 +02:00
|
|
|
name: Deploy documentation
|
|
|
|
on:
|
2021-08-21 15:00:14 +02:00
|
|
|
workflow_dispatch:
|
2021-05-04 01:42:52 +02:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
docs:
|
|
|
|
name: Build and Deploy
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
rust-toolchain:
|
|
|
|
- nightly
|
|
|
|
php:
|
|
|
|
- '8.0'
|
|
|
|
llvm:
|
|
|
|
- '11.0'
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php }}
|
|
|
|
- name: Setup Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.rust-toolchain }}
|
2021-09-05 07:56:29 +02:00
|
|
|
override: true
|
2021-05-04 01:42:52 +02:00
|
|
|
- name: Setup LLVM & Clang
|
|
|
|
uses: KyleMayes/install-llvm-action@v1
|
|
|
|
with:
|
|
|
|
version: ${{ matrix.llvm }}
|
|
|
|
directory: ${{ runner.temp }}/llvm-${{ matrix.llvm }}
|
2021-08-21 15:00:14 +02:00
|
|
|
- name: Install mdbook
|
2021-08-21 15:24:51 +02:00
|
|
|
uses: peaceiris/actions-mdbook@v1
|
2021-08-21 15:00:14 +02:00
|
|
|
with:
|
2021-08-21 15:24:51 +02:00
|
|
|
mdbook-version: latest
|
2021-05-04 01:42:52 +02:00
|
|
|
- name: Build docs
|
|
|
|
env:
|
|
|
|
LIBCLANG_PATH: ${{ runner.temp }}/llvm-${{ matrix.llvm }}/lib
|
2021-09-05 04:18:03 +02:00
|
|
|
RUSTDOCFLAGS: --cfg docs
|
2021-09-05 08:00:52 +02:00
|
|
|
run: cargo doc --release
|
2021-08-21 15:00:14 +02:00
|
|
|
- name: Build guide
|
|
|
|
run: |
|
|
|
|
mdbook build guide
|
|
|
|
mv guide/book target/doc/guide
|
2021-05-04 01:42:52 +02:00
|
|
|
- name: Create index redirect
|
|
|
|
run: |
|
|
|
|
echo '<meta http-equiv=refresh content=0;url=/ext-php-rs/ext_php_rs>' > target/doc/index.html
|
|
|
|
- name: Publish docs
|
|
|
|
uses: JamesIves/github-pages-deploy-action@3.7.1
|
|
|
|
with:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
BRANCH: gh-pages
|
|
|
|
FOLDER: target/doc
|
|
|
|
CLEAN: true
|