Merge pull request #104 from makeabilitylab/ci/github-actions-jekyll-… #1
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
| # Build the Jekyll site with GitHub Actions and deploy it to GitHub Pages. | |
| # | |
| # This replaces the default "deploy from a branch" GitHub Pages build (which | |
| # only runs whitelisted plugins and no custom build steps) with a full | |
| # `bundle exec jekyll build` running in CI. That unlocks custom plugins, | |
| # build-time code inlining, and content lint/test gates. See issue #98. | |
| # | |
| # IMPORTANT: this workflow only takes over publishing once the repo's | |
| # Pages "Source" is switched from "Deploy from a branch" to "GitHub Actions" | |
| # (Settings -> Pages -> Build and deployment -> Source). Until then it builds | |
| # but the deploy step will not publish. | |
| name: Build and deploy Jekyll site to Pages | |
| on: | |
| # Run on every push to the live branch. | |
| push: | |
| branches: ["main"] | |
| # Allow manual runs from the Actions tab. | |
| workflow_dispatch: | |
| # Minimum permissions the deploy job needs to publish to Pages. | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow one concurrent deployment; don't cancel an in-progress production | |
| # deploy if another push lands while it's running. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| # Matches .ruby-version. bundler-cache installs the Gemfile (still | |
| # the github-pages gem, so the build is byte-for-byte the current | |
| # one) and caches gems between runs. | |
| ruby-version: "3.3.11" | |
| bundler-cache: true | |
| cache-version: 0 | |
| - name: Setup Pages | |
| id: pages | |
| uses: actions/configure-pages@v5 | |
| - name: Build with Jekyll | |
| # base_path comes out as "/physcomp", matching baseurl in _config.yml. | |
| run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" | |
| env: | |
| JEKYLL_ENV: production | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |