diff --git a/.github/workflows/openfe-doc-build.yaml b/.github/workflows/openfe-doc-build.yaml index 7b8b044..77c334d 100644 --- a/.github/workflows/openfe-doc-build.yaml +++ b/.github/workflows/openfe-doc-build.yaml @@ -2,26 +2,58 @@ name: Test openfe doc build on: workflow_dispatch: + push: + branches: + - main + pull_request: + branches: + - main + schedule: + # nightly tests, 2 am + - cron: "0 2 * * *" + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +defaults: + run: + shell: bash -leo pipefail {0} jobs: test-conda-build: runs-on: ubuntu-latest steps: - - name: Checkout ExampleNotebooks repository - uses: actions/checkout@v4 - with: - path: openfe/docs/ - - name: Checkout conda-forge feedstock uses: actions/checkout@v4 with: repository: OpenFreeEnergy/openfe path: openfe - - name: Test file layout + - name: Checkout ExampleNotebooks repository + uses: actions/checkout@v4 + with: + path: openfe/docs/ExampleNotebooks + + - name: Get current date + id: date + run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}" + + - name: Install doc environment + uses: mamba-org/setup-micromamba@v2 + with: + environment-file: openfe/docs/environment.yaml + cache-environment: true + cache-downloads: true + cache-environment-key: environment-${{ steps.date.outputs.date }} + cache-downloads-key: downloads-${{ steps.date.outputs.date }} + init-shell: bash + + - name: Build the docs run: | - pwd - ls -l - ls -l * - ls -l openfe/docs + cd openfe + # install so that we can get a version metadata we use in docs + pip install . --no-deps + cd docs + make html