Merge pull request #65 from foundryside-dev/site-design-system-and-pages #2
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 Filigree member Astro site (site/) and deploy to GitHub Pages. | |
| # | |
| # The site deploys to filigree.foundryside.dev (CNAME in site/public/CNAME, | |
| # copied verbatim into the build output). It consumes the shared @weft/site-kit, | |
| # which lives in a SUBDIRECTORY of a DIFFERENT repo (the weft hub). npm cannot | |
| # install a git subdirectory directly, so we sparse-fetch the kit into | |
| # vendor/site-kit (scripts/fetch-site-kit.mjs) BEFORE `npm install`, then | |
| # depend on it via "file:./vendor/site-kit". The fetch also runs from the | |
| # package "preinstall" hook; running it explicitly first keeps the step | |
| # legible and lets `npm install` resolve the file: dep on the first pass. | |
| name: Deploy filigree site | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'site/**' | |
| - '.github/workflows/deploy-site.yml' | |
| workflow_dispatch: | |
| # GitHub Pages deploy permissions. | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # One in-flight Pages deploy at a time; don't cancel a running deploy. | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: site | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure Pages | |
| # Pin the Pages source to GitHub Actions (build_type=workflow); enables | |
| # Pages if needed. Without this, deploy-pages fails when the repo is | |
| # still set to "Deploy from a branch". | |
| uses: actions/configure-pages@v5 | |
| with: | |
| enablement: true | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Fetch @weft/site-kit | |
| # Sparse-fetch packages/site-kit from the weft hub into vendor/site-kit | |
| # so the "file:./vendor/site-kit" dependency resolves on install. | |
| run: node ./scripts/fetch-site-kit.mjs | |
| - name: Install | |
| run: npm install --no-audit --no-fund | |
| - name: Build | |
| # prebuild hook copies @weft/site-kit/assets into public/_site-kit. | |
| run: npm run build | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: site/dist | |
| 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 |