Skip to content

Add info from one-pager (#206) #424

Add info from one-pager (#206)

Add info from one-pager (#206) #424

Workflow file for this run

name: Build and Publish Documentation
on:
pull_request:
workflow_dispatch:
create:
push:
branches:
- main
jobs:
build-deploy:
if: ${{ github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository) }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set github reference as Slug environment variable
run: |
echo "Slug=$(echo "${{ github.head_ref }}" | sed "s/\//\-/g")" >> "$GITHUB_ENV"
- name: If no github.head_ref, use last chunk of github.ref as Slug
if: github.head_ref == ''
run: |
IFS="\/";
read -a strarr <<< "${{ github.ref }}";
last_ref="${strarr[${#strarr[*]}-1]}";
echo "Slug=$(echo $last_ref)" >> "$GITHUB_ENV"
- name: Document which reference
run: echo "Running for reference ${{ env.Slug }}"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Build docs
run: |
git fetch origin gh-pages --depth=1
mike deploy --push --rebase ${{ env.Slug }}
echo "Documentation available at: http://tides-transit.github.io/TIDES/${{ env.Slug }}"
comment:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.merged == false && github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.number }}
comment-author: "github-actions[bot]"
body-includes: "Documentation available at:"
- uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.number }}
body: "Documentation available at: [`http://tides-transit.github.io/TIDES/${{ github.head_ref }}`](http://tides-transit.github.io/TIDES/${{ github.head_ref }})"
edit-mode: replace