add a quiz to the concepts chapter #250
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Deploy DataJoint Book | |
| # Run on pushes to the main branch and on pull requests | |
| on: | |
| push: | |
| # Runs on pushes targeting the default branch | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| # `BASE_URL` determines the website served from, including CSS and JS assets | |
| 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. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout your repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js and cache dependencies | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' # Using a more current LTS version | |
| cache: 'npm' # Cache npm packages for faster subsequent runs | |
| - name: Install MyST Markdown | |
| run: npm install -g mystmd | |
| - name: Build HTML assets | |
| run: | | |
| cd book | |
| myst build --html | |
| - name: Upload artifact for deployment | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: './book/_build/html' | |
| name: github-pages | |
| retention-days: 1 # save storage | |
| deploy: | |
| # Requires the build job to succeed | |
| needs: build | |
| # Deploy only when pushing to the main branch, not on pull requests | |
| if: github.ref == 'refs/heads/main' | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |