-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (48 loc) · 1.58 KB
/
pretext-deploy.yml
File metadata and controls
64 lines (48 loc) · 1.58 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
60
61
62
63
64
# This file was automatically generated with PreTeXt 2.21.0.
# If you modify this file, PreTeXt will no longer automatically update it.
#
name: Build and Deploy
on:
# Currently, this workflow only runs when manually selected (the `workflow_dispatch` event).
# If you would like it to run on other events, uncomment some of the lines below.
# # Runs on pull requests
# pull_request:
# branches: ["*"]
# # Runs on pushes to main
# push:
# branches: ["main"]
# # Runs every day at 00:00 UTC
# schedule:
# - cron: '0 0 * * *'
# Runs on demand
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
container: pretextbook/pretext-full
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: add gh-cli
run: |
apt-get update
apt-get install gh jq -y
- name: setup git config
run: |
git config --global --add safe.directory $(pwd)
git config user.name "${{ github.actor }} via GitHub Actions"
git config user.email "${{ github.actor }}@github_actions.no_reply"
- name: install deps
run: pip install -r requirements.txt --break-system-packages
- name: install local ptx files
run: pretext --version
- name: build deploy targets
run: pretext build --deploys
- name: run deploy
run: pretext deploy --no-push
- name: push gh-pages branch
run: git push origin gh-pages --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}