Skip to content

Commit aa1b8ad

Browse files
committed
add CacheNotebooks
1 parent 266c951 commit aa1b8ad

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Cache notebooks
2+
3+
on:
4+
schedule:
5+
- cron: '00 02 * * 2'
6+
workflow_dispatch:
7+
8+
jobs:
9+
cache-notebooks:
10+
runs-on: ubuntu-latest
11+
steps:
12+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
13+
- name: Checkout caching branch
14+
uses: actions/checkout@v4
15+
with:
16+
ref: tutorial_notebooks
17+
18+
- name: Delete files and history
19+
shell: bash
20+
run: |
21+
git config user.name "Documenter.jl"
22+
git config user.email "[email protected]"
23+
git rm -rf --ignore-unmatch "*"
24+
git commit -m "delete files" --allow-empty
25+
git branch tutorial_notebooks_new $(echo "delete history" | git commit-tree HEAD^{tree})
26+
- name: Copy files
27+
run: |
28+
git fetch origin
29+
git checkout tutorial_notebooks_new
30+
curl https://raw.githubusercontent.com/trixi-framework/Trixi.jl/docs/Project.toml --output Project.toml
31+
sed -i '1 a Trixi = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb"' Project.toml
32+
cat Project.toml
33+
# `stable` is a symlink, so we need to retrieve it first to resolve it locally
34+
git checkout origin/gh-pages -- stable
35+
git checkout origin/gh-pages -- `readlink stable`/tutorials/notebooks/
36+
mv `readlink stable`/tutorials/ tutorials
37+
rmdir `readlink stable`
38+
rm stable
39+
git add -A && git commit -m "Copy files"
40+
- name: Push changes
41+
run: |
42+
git push --force origin tutorial_notebooks_new:tutorial_notebooks
43+
- name: Cache binder build on mybinder.org
44+
uses: jupyterhub/repo2docker-action@master
45+
with:
46+
NO_PUSH: true
47+
MYBINDERORG_TAG: tutorial_notebooks

0 commit comments

Comments
 (0)