67 lines
1.6 KiB
YAML
67 lines
1.6 KiB
YAML
name: Docs
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
schedule:
|
|
- cron: '0 0 * * *'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
|
|
|
|
Docs:
|
|
if: ${{ !(github.event_name != 'pull_request' && github.actor == 'dependabot[bot]') }}
|
|
runs-on: ubuntu-latest
|
|
name: '📓 Docs'
|
|
steps:
|
|
|
|
- name: '🧰 Checkout'
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: 🛠️ Setup environment
|
|
run: |
|
|
sudo apt update -qq
|
|
sudo apt install -y make
|
|
make env
|
|
|
|
- name: 📓 Build the documentation
|
|
run: |
|
|
. ./env/conda/bin/activate f4pga-docs
|
|
make html
|
|
|
|
- name: '📤 Upload artifact: Sphinx HTML'
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: Documentation-HTML
|
|
path: _build/html
|
|
|
|
- name: 🚀 Publish site to GitHub Pages
|
|
if: github.event_name != 'pull_request'
|
|
run: |
|
|
cd _build/html
|
|
touch .nojekyll
|
|
git init
|
|
cp ../../.git/config ./.git/config
|
|
git add .
|
|
git config --local user.email "BuildTheDocs@GitHubActions"
|
|
git config --local user.name "GitHub Actions"
|
|
git commit -a -m "update ${{ github.sha }}"
|
|
git push -u origin +HEAD:gh-pages
|
|
|
|
|
|
Automerge:
|
|
needs: Docs
|
|
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
|
|
runs-on: ubuntu-latest
|
|
name: Automerge dependabot PRs
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
|
|
- name: Auto-merge Dependabot PR
|
|
run: GITHUB_TOKEN='${{ github.token }}' gh pr merge '${{ github.event.pull_request.html_url }}' --squash
|