diff --git a/.github/workflows/ci_publish.yml b/.github/workflows/ci_publish.yml index 988246ac..2053ad41 100644 --- a/.github/workflows/ci_publish.yml +++ b/.github/workflows/ci_publish.yml @@ -4,6 +4,8 @@ on: push: branches: - main + schedule: + - cron: '0 8 * * 5' workflow_dispatch: concurrency: @@ -20,7 +22,6 @@ jobs: publish_html: if: >- - (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' && github.repository == 'Caltech-IPAC/irsa-tutorials' @@ -37,11 +38,23 @@ jobs: - name: Install dependencies run: python -m pip install --upgrade tox + # We use the cache conditionally dependencing on the trigger event, keep it read only for cron - name: Using execution-output cache + if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: _build/execute - key: JB-output + key: JB-output-${{ github.run_id }} + kestore-keys: | + JB-output- + + - name: Using execution-output cache for cron + if: (github.event_name == 'schedule' ) + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: _build/execute + kestore-keys: | + JB-output- - name: Execute notebooks while building HTMLs run: tox -e py312-buildhtml @@ -55,6 +68,7 @@ jobs: path: ./_build - name: Publish + if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0 with: github_token: ${{ secrets.GITHUB_TOKEN }}