Add Docker definitions for Ubuntu #51
Workflow file for this run
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
| # SPDX-FileCopyrightText: 2026 Kaito Udagawa <umireon@kaito.tokyo> | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: Pages CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| schedule: | |
| - cron: '43 2 * * *' # Every day at 2:43 UTC | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| BUILD_PATH: pages | |
| jobs: | |
| build: | |
| name: Build Pages | |
| runs-on: ubuntu-slim | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Node | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version-file: ${{ env.BUILD_PATH }}/.node-version | |
| cache: npm | |
| cache-dependency-path: ${{ env.BUILD_PATH }}/package-lock.json | |
| - name: Setup Pages | |
| id: pages | |
| uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 | |
| - name: Install dependencies | |
| shell: bash | |
| working-directory: ${{ env.BUILD_PATH }} | |
| run: npm ci | |
| - name: Build with Astro | |
| shell: bash | |
| working-directory: ${{ env.BUILD_PATH }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SITE: ${{ steps.pages.outputs.origin }} | |
| BASE: ${{ steps.pages.outputs.base_path }} | |
| PRODUCTION_BASE_URL: ${{ steps.pages.outputs.base_url }} | |
| run: | | |
| set -euo pipefail | |
| npx astro build --site "$SITE" --base "$BASE" | |
| node scripts/add-sri.mjs "$PRODUCTION_BASE_URL" dist | |
| node scripts/add-csp-hashes.mjs dist | |
| node scripts/generate-provenance.mjs "$PRODUCTION_BASE_URL" dist provenance.json | |
| mv provenance.json dist/provenance.json | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: pages-build | |
| path: ${{ env.BUILD_PATH }}/dist | |
| if-no-files-found: error | |
| deploy: | |
| name: Deploy Pages | |
| if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | |
| needs: build | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-slim | |
| timeout-minutes: 10 | |
| permissions: | |
| attestations: write | |
| contents: read | |
| id-token: write | |
| pages: write | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: pages-build | |
| path: dist | |
| # Establish chain of trust by attesting the provenance of the build artifact. | |
| - name: Attest site provenance | |
| id: attest | |
| uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0 | |
| with: | |
| subject-path: dist/provenance.json | |
| - name: Copy attestation bundle | |
| env: | |
| BUNDLE_PATH: ${{ steps.attest.outputs.bundle-path }} | |
| shell: bash | |
| run: cp "$BUNDLE_PATH" dist/provenance.attestation.json | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 | |
| with: | |
| path: dist | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 |