From bcd41f9c2d2e8099bd562ddb01354589fdacaa67 Mon Sep 17 00:00:00 2001 From: Steven Clontz Date: Wed, 8 May 2024 14:24:17 +0000 Subject: [PATCH] update pretext --- .devcontainer.json | 3 ++ .github/workflows/deploy.yml | 74 ++++++++++++++++++++++++++++++++ .github/workflows/test-build.yml | 35 +++++++++++++++ project.ptx | 5 ++- project.ptx.bak | 7 +++ requirements.txt | 2 +- 6 files changed, 123 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/test-build.yml create mode 100644 project.ptx.bak diff --git a/.devcontainer.json b/.devcontainer.json index ec02345..732ab66 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -26,6 +26,9 @@ "ghcr.io/devcontainers/features/github-cli:1": {} }, + // Respect the project's designated dependencies + "postCreateCommand": "pip install -r requirements.txt", + // Port forwarding // --------------- // This is needed by the CodeChat Server. diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..490e309 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,74 @@ +# +# (delete the above line to manage this file manually) + +name: Deploy to GitHub pages +on: +# Uncomment to automatically deploy when a commit is pushed to +# the main (or otherwise configured) branch (and remove auto +# management line at top of this file) + push: + branches: ["main"] +# The below allows for manually deploying by running the action +# via GitHub.com + workflow_dispatch: + +jobs: + # This job builds the book. You can download the resulting build "artifact" by + # navigating to your actions manager in Github, selecting this run, and clicking + # "download artifact" on the "website" artifact. + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout source + uses: actions/checkout@v4 + + - name: Build web with PreTeXt + uses: siefkenj/pretext-build-action@main + with: + pretext-command: build web + project-root: "." + output-dir: "." + + - name: Stage with PreTeXt + uses: siefkenj/pretext-build-action@main + with: + pretext-command: deploy --stage-only + project-root: "." + output-dir: "." + + - name: Bundle output/stage as artifact + uses: actions/upload-artifact@v4 + with: + name: website + path: output/stage + + # This job deploys the artifact built in the previous job to Github pages. + deploy: + runs-on: ubuntu-latest + needs: build + permissions: + contents: read + pages: write + id-token: write + concurrency: + group: "page" + cancel-in-progress: false + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Download website artifact + uses: actions/download-artifact@v4 + with: + name: website + path: website + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: "./website" + - name: Deploy to Github Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml new file mode 100644 index 0000000..0adc5ec --- /dev/null +++ b/.github/workflows/test-build.yml @@ -0,0 +1,35 @@ +# +# (delete the above line to manage this file manually) + +name: Test Build +on: + # Runs on pull requests, when a pull request is merged into main, + # and when a commit is otherwise pushed to main. + push: + branches: ["main"] + pull_request: + branches: ["*"] + +jobs: + # This job builds the book. You can download the resulting build "artifact" by + # navigating to your actions manager in Github, selecting this run, and clicking + # "download artifact" on the "website" artifact. + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout source + uses: actions/checkout@v4 + + - name: Build web target with PreTeXt + uses: siefkenj/pretext-build-action@main + with: + pretext-command: build web + project-root: "." + output-dir: "." + + - name: Bundle output/web as artifact + uses: actions/upload-artifact@v4 + with: + name: website + path: output/web diff --git a/project.ptx b/project.ptx index f2497ee..10faf1f 100644 --- a/project.ptx +++ b/project.ptx @@ -1,7 +1,8 @@ + - - + + diff --git a/project.ptx.bak b/project.ptx.bak new file mode 100644 index 0000000..f2497ee --- /dev/null +++ b/project.ptx.bak @@ -0,0 +1,7 @@ + + + + + + + diff --git a/requirements.txt b/requirements.txt index dd563a3..1a1a7c4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ # -pretext == 2.3.4 +pretext == 2.4.0