-
Notifications
You must be signed in to change notification settings - Fork 28
59 lines (51 loc) · 1.62 KB
/
codespace-template.yml
File metadata and controls
59 lines (51 loc) · 1.62 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
56
57
58
59
name: deploy-codespace-template
on:
# Runs on completion of the deploy-stable workflow
workflow_run:
workflows: ["deploy-stable"]
branches: ["main"]
types:
- completed
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Checkout codespace
uses: actions/checkout@v4
with:
repository: PreTeXtBook/pretext-codespace
token: ${{ secrets.PUSH_CODESPACES }}
- name: Install pretext
run: |
python -m ensurepip
python -m pip install --upgrade pip
python -m pip install --upgrade pretext
python -m pretext --version
- name: pretext new hello
shell: bash
run: |
rm -rf *
rm -rf .devcontainer
rm -rf .gitignore
python -m pretext new hello -d .
- name: setup git config
run: |
# setup the username and email.
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor }}@users.noreply.github.com
- name: restore previous files
run: |
git restore README.md
git restore LICENSE
- name: commit (only .devcontainer and .gitignore files)
run: |
# Stage the file, commit and push
git add .devcontainer/*
git add .gitignore
git commit -m "update to latest `devcontainer files`" || echo "No new commit needed"
git push origin main || echo "All done"