Build #305
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
| name: Build | |
| on: | |
| push: | |
| workflow_dispatch: | |
| inputs: | |
| repo: | |
| description: 'repo name' | |
| required: false | |
| schedule: | |
| - cron: "0 0 * * *" | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| run-name: Build ${{ github.event.inputs.repo }} | |
| jobs: | |
| deploy: | |
| concurrency: | |
| group: ${{ github.event.inputs.repo && 'incremental-build' || github.sha }} | |
| cancel-in-progress: false | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| name: Build Website | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Restore cache (incremental build) | |
| if: ${{ github.event.inputs.repo }} | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| .cache | |
| .data-cache | |
| dist | |
| key: modules-build-cache-${{ github.run_id }} | |
| restore-keys: modules-build-cache- | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Install runzip | |
| run: | | |
| wget -q -O /usr/local/bin/runzip https://github.com/Ylarod/runzip/releases/download/v0.1.8/runzip-x86_64-unknown-linux-gnu | |
| chmod +x /usr/local/bin/runzip | |
| - name: Fetch module data | |
| run: bun run scripts/fetch-data.ts | |
| env: | |
| GRAPHQL_TOKEN: ${{ secrets.GRAPHQL_TOKEN }} | |
| REPO: ${{ github.event.inputs.repo }} | |
| - name: Build | |
| run: bun run build | |
| - name: Save cache | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| .cache | |
| .data-cache | |
| dist | |
| key: modules-build-cache-${{ github.run_id }} | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'dist' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |