Skip to content

Commit 6c4a455

Browse files
authored
Add deploy workflow (#956)
* fix spelling error with install scripts; fix markdown for readme's * add deploy action that uses `pretext deploy`.
1 parent 6121c02 commit 6c4a455

11 files changed

Lines changed: 123 additions & 69 deletions

File tree

pretext/constants.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,10 @@
229229
"devcontainer.json": Path(".devcontainer/devcontainer.json"),
230230
"requirements.txt": Path("requirements.txt"),
231231
"pretext-cli.yml": Path(".github", "workflows", "pretext-cli.yml"),
232-
"installPretext.sh": Path(".devcontainer", "instalPretext.sh"),
233-
"installPandoc.sh": Path(".devcontainer", "instalPandoc.sh"),
234-
"installLatex.sh": Path(".devcontainer", "instalLatex.sh"),
232+
"pretext-deploy.yml": Path(".github", "workflows", "pretext-deploy.yml"),
233+
"installPretext.sh": Path(".devcontainer", "installPretext.sh"),
234+
"installPandoc.sh": Path(".devcontainer", "installPandoc.sh"),
235+
"installLatex.sh": Path(".devcontainer", "installLatex.sh"),
235236
"installSage.sh": Path(".devcontainer", "installSage.sh"),
236237
}
237238

@@ -244,6 +245,7 @@
244245
GIT_RESOURCES = [
245246
".gitignore",
246247
"pretext-cli.yml",
248+
"pretext-deploy.yml",
247249
"devcontainer.json",
248250
"installPretext.sh",
249251
"installPandoc.sh",

pretext/resources/resource_hash_table.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,11 @@
109109
"project.ptx": "ac4c1327126f021006b2e043df35287e593c5c89de2f5d7bcc3e653227b46e0e",
110110
"codechat_config.yaml": "dd2a54caa22b056fd4442b39c230adb359e61a195fcad921c1733c5beea0f89f",
111111
".gitignore": "7df710ee93f2d5b67d3b90292f195b35c2053915eec3a4265a440585a2c94816",
112-
"devcontainer.json": "21c7b3bde8d88e2bd0956221d0f7b935c021738f6e078d9798831785326ffa4d",
113-
"pretext-cli.yml": "419d0487e446a6ec7d1c9a1f78c431dd7ac8f7e5fe683d772685110d1ca99e14",
114-
"installPretext.sh": "e6d198cad4402d18965fbbd7e40b05c4dc858b4d334536b3c00fc835a971e4e6",
115-
"installPandoc.sh": "1d73faa032b137af74dcb9fad2cbc4f70da3bf09a682f90cc213943d4e60710c",
112+
"devcontainer.json": "4d8a29737ff080e9312bad1646262cdf40f54e7e017298d0f59a1cab7fde6955",
113+
"pretext-cli.yml": "2436f740b3d9aa1b1c64ff5da9a2ef281c12087267225d3c9870ccf0c6d87b16",
114+
"pretext-deploy.yml": "2f02ebfe0ae2a54edf8e66561e906567424cec5b5467db7d6dd891b56e23ca7b",
115+
"installPretext.sh": "8b4ffc06b5bfd75b63ea2f06406ba72e88c6a1f70ddd365e3eed3d4099bf3a92",
116+
"installPandoc.sh": "0dfd2cf2455efeff82293ba2b3724bc94e20620ed9f87c4cd3ee967d0dedd076",
116117
"installLatex.sh": "89fc36da1ac5bf3c79e70990d760f288b94afb71dac03f0651424efbf55663aa",
117118
"installSage.sh": "7f2b791271aaf21a0b6c742e9758d4f131b59216c261902fe43c8461143cb407"
118119
}

templates/article/README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,17 @@ The most important thing to remember when authoring in a codespace is that you a
3636
We have tried to keep the codespace small (so it starts up quickly and doesn't eat through your monthly storage allotment), so we do not include a full TeXLive distribution. We have tried to include most packages and fonts you are likely to need to generate images using `<latex-image>` elements, and to generate PDF print output. However, if you run into a situation where the LaTeX gives errors about packages missing (like it cannot find a `mypackage.sty` file), here is what you should do.
3737

3838
1. To quickly resolve the issue yourself, open a terminal (``Ctrl+Shift+` ``) and use the TeXLive Package Manager to install the missing package.
39-
1. If you know that the package is called `mypackage` then enter the following two lines:
39+
a. If you know that the package is called `mypackage` then enter the following two lines:
4040

41-
```bash
42-
tlmgr install mypackage
43-
tlmgr path add
44-
```
45-
46-
2. If you don't know the name of the package, but know it should contain `mypackage.sty`, then you can search using
47-
48-
```bash
49-
tlmgr search --global --all "mypackage.sty"
50-
```
41+
```bash
42+
tlmgr install mypackage
43+
tlmgr path add
44+
```
45+
b. If you don't know the name of the package, but know it should contain `mypackage.sty`, then you can search using
5146
47+
```bash
48+
tlmgr search --global --all "mypackage.sty"
49+
```
5250
5351
2. To ensure that you don't have to repeat this step every time you recreate the codespace, add the package name to the list of installs inside the file `.devcontainer/installLatex.sh` which gets run every time a codespace is created.
5452

templates/book/README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,17 @@ The most important thing to remember when authoring in a codespace is that you a
3737
We have tried to keep the codespace small (so it starts up quickly and doesn't eat through your monthly storage allotment), so we do not include a full TeXLive distribution. We have tried to include most packages and fonts you are likely to need to generate images using `<latex-image>` elements, and to generate PDF print output. However, if you run into a situation where the LaTeX gives errors about packages missing (like it cannot find a `mypackage.sty` file), here is what you should do.
3838

3939
1. To quickly resolve the issue yourself, open a terminal (``Ctrl+Shift+` ``) and use the TeXLive Package Manager to install the missing package.
40-
1. If you know that the package is called `mypackage` then enter the following two lines:
40+
a. If you know that the package is called `mypackage` then enter the following two lines:
4141

42-
```bash
43-
tlmgr install mypackage
44-
tlmgr path add
45-
```
46-
47-
2. If you don't know the name of the package, but know it should contain `mypackage.sty`, then you can search using
48-
49-
```bash
50-
tlmgr search --global --all "mypackage.sty"
51-
```
42+
```bash
43+
tlmgr install mypackage
44+
tlmgr path add
45+
```
46+
b. If you don't know the name of the package, but know it should contain `mypackage.sty`, then you can search using
5247
48+
```bash
49+
tlmgr search --global --all "mypackage.sty"
50+
```
5351
5452
2. To ensure that you don't have to repeat this step every time you recreate the codespace, add the package name to the list of installs inside the file `.devcontainer/installLatex.sh` which gets run every time a codespace is created.
5553

@@ -59,5 +57,4 @@ tlmgr search --global --all "mypackage.sty"
5957
6058
By far the largest space-hog in a PreTeXt authoring environment is SageMath, which is only required if you generate images using sageplots. By default, SageMath is not installed in a PreTeXt codespace, but it should be easy to install if you need it.
6159
62-
Just open the command palette (`Ctrl+Shift+P` of `F1`) and search for "PreTeXt: Install SageMath". This will also update the `.devcontainer/devcontainer.json` file so that the next time you create a codespace for this project, it should install automatically.
63-
60+
Just open the command palette (`Ctrl+Shift+P` of `F1`) and search for "PreTeXt: Install SageMath". This will also update the `.devcontainer/devcontainer.json` file so that the next time you create a codespace for this project, it should install automatically.

templates/course/README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,17 @@ The most important thing to remember when authoring in a codespace is that you a
6262
We have tried to keep the codespace small (so it starts up quickly and doesn't eat through your monthly storage allotment), so we do not include a full TeXLive distribution. We have tried to include most packages and fonts you are likely to need to generate images using `<latex-image>` elements, and to generate PDF print output. However, if you run into a situation where the LaTeX gives errors about packages missing (like it cannot find a `mypackage.sty` file), here is what you should do.
6363

6464
1. To quickly resolve the issue yourself, open a terminal (``Ctrl+Shift+` ``) and use the TeXLive Package Manager to install the missing package.
65-
1. If you know that the package is called `mypackage` then enter the following two lines:
65+
a. If you know that the package is called `mypackage` then enter the following two lines:
6666

67-
```bash
68-
tlmgr install mypackage
69-
tlmgr path add
70-
```
71-
72-
2. If you don't know the name of the package, but know it should contain `mypackage.sty`, then you can search using
73-
74-
```bash
75-
tlmgr search --global --all "mypackage.sty"
76-
```
67+
```bash
68+
tlmgr install mypackage
69+
tlmgr path add
70+
```
71+
b. If you don't know the name of the package, but know it should contain `mypackage.sty`, then you can search using
7772
73+
```bash
74+
tlmgr search --global --all "mypackage.sty"
75+
```
7876
7977
2. To ensure that you don't have to repeat this step every time you recreate the codespace, add the package name to the list of installs inside the file `.devcontainer/installLatex.sh` which gets run every time a codespace is created.
8078

templates/demo/README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,17 @@ The most important thing to remember when authoring in a codespace is that you a
3737
We have tried to keep the codespace small (so it starts up quickly and doesn't eat through your monthly storage allotment), so we do not include a full TeXLive distribution. We have tried to include most packages and fonts you are likely to need to generate images using `<latex-image>` elements, and to generate PDF print output. However, if you run into a situation where the LaTeX gives errors about packages missing (like it cannot find a `mypackage.sty` file), here is what you should do.
3838

3939
1. To quickly resolve the issue yourself, open a terminal (``Ctrl+Shift+` ``) and use the TeXLive Package Manager to install the missing package.
40-
1. If you know that the package is called `mypackage` then enter the following two lines:
40+
a. If you know that the package is called `mypackage` then enter the following two lines:
4141

42-
```bash
43-
tlmgr install mypackage
44-
tlmgr path add
45-
```
46-
47-
2. If you don't know the name of the package, but know it should contain `mypackage.sty`, then you can search using
48-
49-
```bash
50-
tlmgr search --global --all "mypackage.sty"
51-
```
42+
```bash
43+
tlmgr install mypackage
44+
tlmgr path add
45+
```
46+
b. If you don't know the name of the package, but know it should contain `mypackage.sty`, then you can search using
5247
48+
```bash
49+
tlmgr search --global --all "mypackage.sty"
50+
```
5351
5452
2. To ensure that you don't have to repeat this step every time you recreate the codespace, add the package name to the list of installs inside the file `.devcontainer/installLatex.sh` which gets run every time a codespace is created.
5553

@@ -60,4 +58,3 @@ tlmgr search --global --all "mypackage.sty"
6058
By far the largest space-hog in a PreTeXt authoring environment is SageMath, which is only required if you generate images using sageplots. By default, SageMath is not installed in a PreTeXt codespace, but it should be easy to install if you need it.
6159
6260
Just open the command palette (`Ctrl+Shift+P` of `F1`) and search for "PreTeXt: Install SageMath". This will also update the `.devcontainer/devcontainer.json` file so that the next time you create a codespace for this project, it should install automatically.
63-

templates/devcontainer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818

1919
// Comment or uncomment lines below if you don't or do need that feature.
2020
"postCreateCommand": {
21-
"install pretext": "bash ./.devcontainer/installPretext.sh",
21+
// "install sagemath": "bash ./.devcontainer/installSage.sh",
2222
"install pandoc": "bash ./.devcontainer/installPandoc.sh",
2323
"install latex": "bash ./.devcontainer/installLatex.sh",
24-
// "install sagemath": "bash ./.devcontainer/installSage.sh",
25-
"working": "echo 'installing additional software into codespace.'"
24+
"install pretext": "bash ./.devcontainer/installPretext.sh"
2625
},
2726

2827

templates/installPandoc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
wget https://github.com/jgm/pandoc/releases/download/3.6.4/pandoc-3.6.4-1-amd64.deb -O pandoc.deb
77

8-
# wait for 30 second and then double check that no other script is using apt-get:
8+
# wait for 60 second and then double check that no other script is using apt-get:
99
sleep 60
1010
while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do
1111
echo "Waiting for apt-get to be free..."

templates/installPretext.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
# This file was automatically generated with PreTeXt 2.16.1.
44
# If you modify this file, PreTeXt will no longer automatically update it.
55

6-
while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do
7-
echo "Waiting for apt-get to be free..."
8-
sleep 15
9-
done
106
sudo apt-get update
117
sudo apt-get install -y --no-install-recommends \
128
python3-louis \
@@ -19,10 +15,6 @@ pip install pretext[homepage,prefigure] --only-binary {greenlet} --break-system
1915

2016
pip install codechat-server --break-system-packages
2117

22-
while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do
23-
echo "Waiting for apt-get to be free..."
24-
sleep 15
25-
done
2618
playwright install-deps
2719

2820
playwright install

templates/pretext-cli.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
# This file was automatically generated with PreTeXt 2.16.1.
22
# If you modify this file, PreTeXt will no longer automatically update it.
33
#
4+
# This workflow file can be used to automatically build a project and create
5+
# an artifact for deployment. It can also be used to deploy the project to
6+
# GitHub Pages or Cloudflare Pages.
7+
#
8+
# The workflow is triggered on pull requests or can be run manually. You can uncomment
9+
# the `push` event to have it run on pushes to the main branch as well.
410
name: PreTeXt-CLI Actions
511
on:
612
# Runs on pull requests
713
pull_request:
814
branches: ["*"]
9-
# Runs on pushes to main
10-
push:
11-
branches: ["main"]
15+
## Runs on pushes to main
16+
#push:
17+
# branches: ["main"]
1218
# Runs on demand
1319
workflow_dispatch:
1420

0 commit comments

Comments
 (0)