Skip to content

Commit c2547ca

Browse files
authored
Merge pull request #124 from mitmath/Fall22-PlutoPages-test
2 parents 3481208 + 9859769 commit c2547ca

File tree

241 files changed

+17049
-22105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+17049
-22105
lines changed

.github/workflows/DeployIfChanged.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/ExportNotebooks.yml

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Spring 21 - Export Pluto notebooks & Deploy
1+
name: Fall 22 - Export Pluto notebooks & Deploy
22
on:
33
push:
44
branches:
5-
- Spring21
5+
- Fall22-PlutoPages-test
66
workflow_dispatch:
77
concurrency:
88
group: export
@@ -12,68 +12,67 @@ jobs:
1212
build-and-deploy:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Checkout Spring 21 source
15+
- name: Checkout Fall 22 source
1616
uses: actions/checkout@v2
1717

18-
- name: Set up notebook state cache
18+
- name: 🙌 Install Julia
19+
uses: julia-actions/setup-julia@v1
20+
with:
21+
version: "1.8"
22+
23+
- name: ⏱ Cache notebook states
1924
uses: actions/cache@v2
2025
with:
21-
path: pluto_state_cache
22-
key: ${{ runner.os }}-pluto_state_cache-v2-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}-${{ hashFiles('**/*.jl') }}
26+
path: _cache
27+
key: ${{ runner.os }}-pluto_state_cache-v3-fall22-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}-${{ github.run_id }}
2328
restore-keys: |
24-
${{ runner.os }}-pluto_state_cache-v2-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}
29+
${{ runner.os }}-pluto_state_cache-v3-fall22-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}
2530
26-
- name: Checkout Fall 20 output
27-
uses: actions/checkout@v2
31+
- name: ⏱ Cache .julia
32+
uses: actions/cache@v2
2833
with:
29-
path: Fall20-franklin-output
30-
ref: Fall20-franklin-output
34+
path: ~/.julia
35+
key: ${{ runner.os }}-dotjulia-v1-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}-${{ github.run_id }}
36+
restore-keys: |
37+
${{ runner.os }}-dotjulia-v1-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}
3138
32-
- name: Install Julia
33-
uses: julia-actions/setup-julia@v1
39+
# - name: 📅 Checkout Fall 20 output
40+
# uses: actions/checkout@v2
41+
# with:
42+
# path: Fall20-franklin-output
43+
# ref: Fall20-franklin-output
44+
45+
- name: 📅 Checkout Fall20 and Spring21 output
46+
uses: actions/checkout@v2
3447
with:
35-
version: 1.7.2
36-
- name: Run Pluto notebooks
48+
path: Spring21-franklin-output
49+
ref: Spring21-franklin-output
50+
51+
- name: 🪴 Generate site
3752
run: julia --project=pluto-deployment-environment -e '
3853
import Pkg;
3954
Pkg.instantiate();
4055

41-
using PlutoSliderServer;
42-
github_action("."; Export_cache_dir="pluto_state_cache");'
43-
- name: Franklin
44-
run: julia -e '
45-
using Pkg;
46-
Pkg.add([
47-
Pkg.PackageSpec(name="NodeJS", version="1.1.1"),
48-
Pkg.PackageSpec(name="JSON", version="0.21.1"),
49-
Pkg.PackageSpec(name="Franklin", version="0.10.28"),
50-
]);
51-
using NodeJS;
52-
53-
"== Run Franklin ==";
54-
cd("website");
56+
include("./generate.jl")'
5557

56-
run(`$(npm_cmd()) install highlight.js`);
57-
using Franklin;
58-
optimize(;minify=false);
59-
mkdir("__site2");
60-
mv("__site", "__site2/Spring21");
61-
mv("../Fall20-franklin-output/Fall20", "__site2/Fall20");
58+
59+
- name: 📰 Upload site generation report
60+
uses: actions/upload-artifact@v2
61+
if: always()
62+
with:
63+
path: generation_report.html
6264

63-
"== Place rendered notebooks in the website folder ==";
64-
cp("../notebooks", "__site2/Spring21/notebooks");
65+
- name: 🔀 Combine semesters into single site
66+
run: |
67+
mkdir www
68+
mv _site www/Fall22
69+
mv Spring21-franklin-output/Fall20/ www/Fall20
70+
mv Spring21-franklin-output/Spring21/ www/Spring21
71+
mv extra_outputs/* www
6572
66-
"== Extra website config files ==";
67-
write("__site2/index.html", """
68-
<!DOCTYPE html>
69-
<html>
70-
<head><meta charset="utf-8"><script>
71-
window.location.href=\"Spring21\"</script></head>
72-
<body></body></html>""");
73-
write("__site2/CNAME", "computationalthinking.mit.edu");'
74-
- name: Build and Deploy
73+
- name: 🚀 Deploy to GitHub Pages
7574
uses: JamesIves/github-pages-deploy-action@releases/v3
7675
with:
7776
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78-
BRANCH: Spring21-franklin-output
79-
FOLDER: website/__site2
77+
BRANCH: Fall22-output
78+
FOLDER: www

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33

44
reduced_phil.png
55
notebooks/week9/testCSVwrite.csv
6+
7+
_cache
8+
_site
9+
generation_report.html
10+
src/week9/testCSVwrite.csv

.vscode/extensions.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
5+
// List of extensions which should be recommended for users of this workspace.
6+
"recommendations": [
7+
"julialang.language-julia",
8+
],
9+
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
10+
"unwantedRecommendations": [
11+
12+
]
13+
}

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"files.associations": {
3+
"*.jlmd": "markdown",
4+
"*.jlhtml": "html",
5+
}
6+
}

.vscode/tasks.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "PlutoPages: run development server",
8+
"type": "shell",
9+
"command": "julia develop.jl",
10+
"group": "build"
11+
}
12+
]
13+
}

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ The material in this repository is licensed as follows:
55
- The **text** is under the [CC BY-SA 4.0 license](https://creativecommons.org/licenses/by-sa/4.0).
66

77

8-
Copyright Alan Edelman, David P. Sanders and Fons van der Plas, 2021
8+
Copyright Alan Edelman, David P. Sanders and Fons van der Plas, 2022

0 commit comments

Comments
 (0)