forked from google/docsy-example
-
Notifications
You must be signed in to change notification settings - Fork 4
79 lines (73 loc) · 3.54 KB
/
markdown-gridded.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: notebook_to_md (gridded)
on:
# External webhook trigger
repository_dispatch:
types: [push-notebook]
jobs:
commit-notebooks:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout site
uses: actions/checkout@v4
with:
submodules: recursive # Fetch Hugo themes and all extra projects
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
path: site
- name: Checkout coast
uses: actions/checkout@v4
with:
repository: British-Oceanographic-Data-Centre/COAsT
ref: develop
path: external
- name: Prepare environement
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: coast
environment-file: external/environment.yml
- name: prep exec notebooks
run: |
conda info
conda list
conda config --show
cd $GITHUB_WORKSPACE/external
sudo apt install wget unzip -y
wget -q https://linkedsystems.uk/erddap/files/COAsT_example_files/COAsT_example_files.zip
unzip COAsT_example_files.zip && mv COAsT_example_files ./example_scripts/notebook_tutorials/runnable_notebooks/gridded/example_files
ls /home/runner/work/COAsT-site/COAsT-site/external/example_scripts/notebook_tutorials/runnable_notebooks/gridded/example_files
mkdir -p ./example_scripts/notebook_tutorials/markdown/gridded
ls ./example_scripts/notebook_tutorials
pip install .
mv config ./example_scripts/notebook_tutorials/runnable_notebooks/gridded/config
bash notebook_to_md.sh gridded
- name: convert notebooks
run: |
cd $GITHUB_WORKSPACE/external/example_scripts/notebook_tutorials/
ls ./markdown
echo "Move gridded markdown examples"
mv ./markdown/gridded/introduction_to_gridded_class.md $GITHUB_WORKSPACE/site/content/en/docs/Examples/Notebooks/Gridded/
mv ./markdown/gridded/contour_tutorial.md $GITHUB_WORKSPACE/site/content/en/docs/Examples/Notebooks/Gridded/
mv ./markdown/gridded/transect_tutorial.md $GITHUB_WORKSPACE/site/content/en/docs/Examples/Notebooks/Gridded/
mv ./markdown/gridded/regridding_with_xesmf_tutorial.md $GITHUB_WORKSPACE/site/content/en/docs/Examples/Notebooks/Gridded/
mv ./markdown/gridded/pycnocline_tutorial.md $GITHUB_WORKSPACE/site/content/en/docs/Examples/Notebooks/Gridded/
mv ./markdown/gridded/seasia_dic_example_plot_tutorial.md $GITHUB_WORKSPACE/site/content/en/docs/Examples/Notebooks/Gridded/
mv ./markdown/gridded/potential_energy_tutorial.md $GITHUB_WORKSPACE/site/content/en/docs/Examples/Notebooks/Gridded/
echo "Move images"
rsync -r ./markdown_images/gridded/ $GITHUB_WORKSPACE/site/static
- name: commit changes
run: |
cd $GITHUB_WORKSPACE/site
git config --global user.name "MarkDownBot"
git config --global author.name "MarkDownBot"
git config --global user.email "[email protected]"
git config --global author.email "[email protected]"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git fetch origin
git checkout develop
git pull
git add content/en/docs/Examples/Notebooks/Gridded/*
git add static/*
git commit -am "Updated Gridded notebook pages from coast repo."
git push origin develop