Skip to content

Include dict (#355) #632

Include dict (#355)

Include dict (#355) #632

# build and test some end points
name: Build and deploy docs for fmu-dataio
# on: [push, pull_request]
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
build_pywheels:
name: PY ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install and build docs
run: |
pip install pip -U && pip install wheel -U
pip install .[docs]
pip install xtgeo
pip install git+https://github.com/equinor/fmu-config
sh examples/run_examples.sh
sphinx-build -b html docs build/docs/html
- name: Update GitHub pages
if: github.repository_owner == 'equinor' && github.ref == 'refs/heads/main'
run: |
cp -R ./build/docs/html ../html
git config --local user.email "fmu-dataio-github-action"
git config --local user.name "fmu-dataio-github-action"
git fetch origin gh-pages
git checkout --track origin/gh-pages
git clean -f -f -d -x # Double -f is intentional.
git rm -r *
cp -R ../html/* .
touch .nojekyll # If not, github pages ignores _* directories.
git add .
echo "Ready for commit"
if git diff-index --quiet HEAD; then
echo "No changes in documentation. Skip documentation deploy."
else
git commit -m "Update Github Pages"
git push "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" gh-pages
fi