feat:1 #32
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 and Check | |
| on: | |
| push: | |
| branches: [ main ] # Adjust branches as needed | |
| pull_request: | |
| branches: [ main ] # Adjust branches as needed | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| check: | |
| strategy: | |
| matrix: | |
| node: [ 22, 23 ] | |
| runs-on: ubuntu-latest | |
| name: Astro Check for Node.js ${{ matrix.node }} | |
| steps: | |
| - name: Setup Node.js | |
| uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 | |
| with: | |
| node-version: ${{ matrix.node }} # Use LTS | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 | |
| with: | |
| run_install: false # Disable auto-install | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run Astro Check | |
| run: pnpm astro check | |
| build: | |
| runs-on: ubuntu-latest | |
| name: Build and Deploy | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 | |
| with: | |
| node-version: 22 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 | |
| with: | |
| run_install: false | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build with Astro | |
| run: pnpm build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 | |
| with: | |
| path: ./dist | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| name: Deploy to GitHub Pages | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 |