name: Build and Deploy to Pages

on:
  push:
    branches: [$default-branch]
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: "pages"
  cancel-in-progress: true

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Setup Node
        uses: actions/setup-node@v3
        with:
          node-version: "16"
          cache: npm
      - name: Restore cache
        uses: actions/cache@v3
        with:
          path: |
            _site
          key: ${{ runner.os }}-eleventy-build-${{ hashFiles('_site') }}
          restore-keys: |
            ${{ runner.os }}-eleventy-build-
      - name: Install dependencies
        run: npm ci
      - name: Static HTML export with Eleventy
        run: npm run build
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v1

  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v1

name: Build and Deploy to Pages

on:
  push:
    branches:
      - main
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: "pages"
  cancel-in-progress: true

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Setup Node
        uses: actions/setup-node@v3
        with:
          node-version: "16"
          cache: npm
      - name: Restore cache
        uses: actions/cache@v3
        with:
          path: |
            _site
          key: ${{ runner.os }}-eleventy-build-${{ hashFiles('_site') }}
          restore-keys: |
            ${{ runner.os }}-eleventy-build-
      - name: Install dependencies
        run: npm ci
      - name: Static HTML export with Eleventy
        run: npm run build
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v1

  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v1

Revert "Update branches from `main` to `$default-branch`"
Revert "Update branches from `main` to `$default-branch`"

This reverts commit 1af12eceaa035df9503fb46f7cc95a9b56360881.
