Skip to content

CI: Add 'staging' radix environment #2073

CI: Add 'staging' radix environment

CI: Add 'staging' radix environment #2073

# build and test some end points
name: Build and deploy docs for fmu-dataio
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
build_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install fmu-dataio
run: |
pip install -U pip
pip install .[docs]
- name: Generate examples
run: sh examples/run_examples.sh
- name: Build documentation
run: sphinx-build -b html docs/src build/docs/html -j auto
- 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