Skip to content

cache number

cache number #4

Workflow file for this run

on:
workflow_dispatch:
push:
branches: main
name: Quarto Publish
permissions:
contents: write
pages: write
jobs:
build-deploy:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout Quarto Book
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout Pythia Book
uses: actions/checkout@v4
with:
repository: tuw-geo/eo-datascience-cookbook
path: eo-datascience-cookbook
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Restore Cache Jupyter Environments
uses: actions/cache@v4
env:
CACHE_NUMBER: 0
with:
path: |
~/.local/share/jupyter/kernels
/usr/share/miniconda/envs
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('chapters/*.yml') }}
- name: Render and Publish
id: setup-python
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Cache Binder Build on mybinder.org
# uses: jupyterhub/repo2docker-action@master
# with:
# NO_PUSH: true
# MYBINDERORG_TAG: ${{ github.event.ref }}
# REPO2DOCKER_EXTRA_ARGS: --subdir notebooks
- name: Commit Files
if: github.ref == 'refs/heads/main'
run: |
NB_PATH=($(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '[.]ipynb$'))
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git commit ${NB_PATH[*]} -m "Quarto output" || echo "No changes to commit"
- name: Push Commit
if: github.ref == 'refs/heads/main'
uses: ad-m/github-push-action@master
with:
directory: eo-datascience-cookbook
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
force: true