GitHub pages with Jigsaw

Cristian Radulescu • August 20, 2022

It is assumed that the setup is done according to the docs Jigsaw setup.

  1. Go to the repository page then Settings -> Pages from the menu;
  2. On Build and deployment section select GitHub Actions;
  3. Go to Actions item form the menu;
  4. Click the New workflow action;
  5. Setup a workflow yourself (click the Skip this and set up a workflow yourself link);
  6. Use the following workflow config:
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
  # Runs on pushes targeting the default branch
  push:
    branches: ["master"]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
  contents: read
  pages: write
  id-token: write

# Allow one concurrent deployment
concurrency:
  group: "pages"
  cancel-in-progress: true

jobs:
  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Install Jigsaw Packages
        run: composer install --no-interaction --no-suggest
      - name: Install NPM Packages
        run: npm install
      - name: Build Static Files
        run: npm run prod
      - name: Setup Pages
        uses: actions/configure-pages@v1
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v1
        with:
          # Use the path generated by Jigsaw
          path: './build_production'
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v1