From 5af3747b16daefe19aa4787e279869017143be51 Mon Sep 17 00:00:00 2001 From: oscarlevin Date: Tue, 16 Jul 2024 02:01:06 +0000 Subject: [PATCH] update to latest Generated `/home/runner/work/pretext-cli/pretext-cli/codechat_config.yaml` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generated `/home/runner/work/pretext-cli/pretext-cli/.gitignore` Generated `/home/runner/work/pretext-cli/pretext-cli/.devcontainer.json` Generated `/home/runner/work/pretext-cli/pretext-cli/requirements.txt` Generated `/home/runner/work/pretext-cli/pretext-cli/.github/workflows/pretext-cli.yml` PreTeXt-CLI version: 2.5.0 PreTeXt project found in `/home/runner/work/pretext-cli/pretext-cli`. error: A project already exists in `/home/runner/work/pretext-cli/pretext-cli`. error: No new project will be generated. ---------------------------------------------------- While running pretext, the following errors occurred: (see log messages above or in the 'logs' folder for more information) ---------------------------------------------------- --- .github/workflows/deploy.yml | 74 ------------------------ .github/workflows/pretext-cli.yml | 93 +++++++++++++++++++++++++++++++ .github/workflows/test-build.yml | 35 ------------ .gitignore | 7 ++- requirements.txt | 2 +- 5 files changed, 100 insertions(+), 111 deletions(-) delete mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/pretext-cli.yml delete mode 100644 .github/workflows/test-build.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 0d968b0..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,74 +0,0 @@ -# -# (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/pretext-cli.yml b/.github/workflows/pretext-cli.yml new file mode 100644 index 0000000..22b8a3c --- /dev/null +++ b/.github/workflows/pretext-cli.yml @@ -0,0 +1,93 @@ +# +# (delete the above line to manage this file manually) + +name: PreTeXt-CLI Actions +on: + # Runs on pull requests + pull_request: + branches: ["*"] + # Runs on pushes to main + push: + branches: ["main"] + # Runs on demand + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + container: oscarlevin/pretext:full + + steps: + - name: Checkout source + uses: actions/checkout@v4 + + - name: install deps + run: pip install -r requirements.txt + + - name: build deploy targets + run: pretext build --deploys + - name: stage deployment + run: pretext deploy --stage-only + + - name: Bundle output/stage as artifact + uses: actions/upload-artifact@v4 + with: + name: deploy + path: output/stage + + deploy-cloudflare: + runs-on: ubuntu-latest + needs: build + if: vars.CLOUDFLARE_PROJECT_NAME != '' + permissions: + contents: read + deployments: write + + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: deploy + path: deploy + - name: Create 404.html + run: echo "404 page not found" >> deploy/404.html + - name: Publish to Cloudflare + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }} + gitHubToken: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.head_ref || github.ref_name }} + directory: deploy + + deploy-ghpages: + runs-on: ubuntu-latest + needs: build + if: vars.PTX_ENABLE_DEPLOY_GHPAGES == 'yes' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + 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: deploy + path: deploy + - name: Setup GitHub Pages + id: check + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: deploy + - 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 deleted file mode 100644 index 0adc5ec..0000000 --- a/.github/workflows/test-build.yml +++ /dev/null @@ -1,35 +0,0 @@ -# -# (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/.gitignore b/.gitignore index 4792506..0096a4e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,9 @@ # ensure this file is tracked !.gitignore -# don't track unpublished builds or stage +# don't track unpublished builds or stage (note: Runestone uses `published`) output +published # don't track assets generated from source generated-assets @@ -97,3 +98,7 @@ GitHub.sublime-settings # Don't track codechat config (will be generated automatically) codechat_config.yaml + +# Don't track deprecated workflows +.github/workflows/deploy.yml +.github/workflows/test-build.yml diff --git a/requirements.txt b/requirements.txt index 02b77f5..9580298 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ # -pretext == 2.4.1 +pretext == 2.5.0