-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (46 loc) · 1.43 KB
/
deployColab.yml
File metadata and controls
55 lines (46 loc) · 1.43 KB
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
# Job to deploy the examples to the known colab links
#
# Assumptions:
# * saveNameNotebooks contains the notebooks built for the site,
# (and also includes the html pages, though we don't need them)
# * Secret passed down which can be used for auth with google.
#
# Effects: google drive saved notebooks are overwritten with the
# given notebooks.
name: Deploy Google Colab notebooks
on:
workflow_call:
inputs:
# The name of the artifact containing the example notebooks built for the site
saveNameNotebooks:
required: true
type: string
secrets:
COLAB_CREDENTIALS:
description: 'Service account access credentials'
required: true
jobs:
deploy-colab:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: ${{inputs.saveNameNotebooks}}
path: ./examples
- name: Remove unneeded HTML
run: rm ./examples/*.html
- name: Add needed install cell in notebooks
shell: bash
run: |
cd examples
pip install nbformat
for name in *.ipynb; do
python3 ../prep_for_colab.py $name
done
- name: Install pydrive2
run: pip install pydrive2
- name: Script to update each file in Drive
env:
COLAB_CREDENTIALS: ${{ secrets.COLAB_CREDENTIALS }}
run: python copy_to_drive.py