|
| 1 | +name: Website |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +jobs: |
| 9 | + install: |
| 10 | + name: Install Dependencies |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Checkout |
| 14 | + uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Setup Tools & Cache |
| 17 | + uses: ./.github/actions/setup |
| 18 | + |
| 19 | + # Cache the installed node_modules directory |
| 20 | + - name: Cache node_modules |
| 21 | + uses: actions/cache@v4 |
| 22 | + id: node_modules_cache_id |
| 23 | + with: |
| 24 | + path: site/node_modules |
| 25 | + key: ${{ runner.os }}-node-modules-${{ hashFiles('site/pnpm-lock.yaml') }} |
| 26 | + |
| 27 | + # If the cache didn't exist, run pnpm install |
| 28 | + - name: Install dependencies |
| 29 | + if: steps.node_modules_cache_id.outputs.cache-hit != 'true' |
| 30 | + working-directory: ./site |
| 31 | + run: pnpm install |
| 32 | + lint: |
| 33 | + name: Lint |
| 34 | + runs-on: ubuntu-latest |
| 35 | + steps: |
| 36 | + - name: Checkout |
| 37 | + uses: actions/checkout@v4 |
| 38 | + |
| 39 | + - name: Setup |
| 40 | + uses: ./.github/actions/setup |
| 41 | + |
| 42 | + - name: Restore node_modules from cache |
| 43 | + uses: actions/cache@v4 |
| 44 | + with: |
| 45 | + path: site/node_modules |
| 46 | + key: ${{ runner.os }}-node-modules-${{ hashFiles('site/pnpm-lock.yaml') }} |
| 47 | + |
| 48 | + - name: Lint |
| 49 | + working-directory: ./site |
| 50 | + run: pnpm run lint |
| 51 | + check: |
| 52 | + name: Svelte Check |
| 53 | + runs-on: ubuntu-latest |
| 54 | + steps: |
| 55 | + - name: Checkout |
| 56 | + uses: actions/checkout@v4 |
| 57 | + |
| 58 | + - name: Setup |
| 59 | + uses: ./.github/actions/setup |
| 60 | + |
| 61 | + - name: Restore node_modules from cache |
| 62 | + uses: actions/cache@v4 |
| 63 | + with: |
| 64 | + path: site/node_modules |
| 65 | + key: ${{ runner.os }}-node-modules-${{ hashFiles('site/pnpm-lock.yaml') }} |
| 66 | + |
| 67 | + - name: Check |
| 68 | + working-directory: ./site |
| 69 | + run: pnpm run check |
| 70 | + build: |
| 71 | + name: Build |
| 72 | + runs-on: ubuntu-latest |
| 73 | + steps: |
| 74 | + - name: Checkout |
| 75 | + uses: actions/checkout@v4 |
| 76 | + |
| 77 | + - name: Setup |
| 78 | + uses: ./.github/actions/setup |
| 79 | + |
| 80 | + - name: Restore node_modules from cache |
| 81 | + uses: actions/cache@v4 |
| 82 | + with: |
| 83 | + path: site/node_modules |
| 84 | + key: ${{ runner.os }}-node-modules-${{ hashFiles('site/pnpm-lock.yaml') }} |
| 85 | + |
| 86 | + - name: Build |
| 87 | + working-directory: ./site |
| 88 | + run: pnpm run build |
0 commit comments