From 327f212505a26acbd184785a3c24402517c8c2db Mon Sep 17 00:00:00 2001 From: Ryan Lovett Date: Thu, 3 Oct 2024 15:16:17 -0700 Subject: [PATCH] Add MyST deploy. --- .github/workflows/book.yml | 42 -------------------------------- .github/workflows/deploy.yml | 46 ++++++++++++++++++++++++++++++++++++ .gitignore | 3 +++ 3 files changed, 49 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/book.yml create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml deleted file mode 100644 index 4bc7220..0000000 --- a/.github/workflows/book.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: deploy-book - -# Only run this when the master branch changes -on: - push: - branches: - - main - # If your git repository has the Jupyter Book within some-subfolder next to - # unrelated files, you can make this run only if a file within that specific - # folder has been modified. - # - # paths: - # - some-subfolder/** - -# This job installs dependencies, builds the book, and pushes it to `gh-pages` -jobs: - deploy-book: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - # Install dependencies - - name: Set up Python 3.7 - uses: actions/setup-python@v1 - with: - python-version: 3.7 - - - name: Install dependencies - run: | - pip install -r requirements.txt - - # Build the book - - name: Build the book - run: | - jupyter-book build . - - # Push the book's HTML to github-pages - - name: GitHub Pages action - uses: peaceiris/actions-gh-pages@v3.6.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./_build/html diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..de0c122 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,46 @@ +# This file was created automatically with `myst init --gh-pages` 🪄 💚 + +name: MyST GitHub Pages Deploy +on: + push: + # Runs on pushes targeting the default branch + branches: [main] +env: + # `BASE_URL` determines the website is served from, including CSS & JS assets + # You may need to change this to `BASE_URL: ''` + BASE_URL: /${{ github.event.repository.name }} + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: 'pages' + cancel-in-progress: false +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v3 + - uses: actions/setup-node@v4 + with: + node-version: 18.x + - name: Install MyST Markdown + run: npm install -g mystmd + - name: Build HTML Assets + run: myst build --html + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: './_build/html' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.gitignore b/.gitignore index 21d6574..6aec54b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,6 @@ _book # Jupyter Book build assets _build/ + +# MyST build outputs +_build