summaryrefslogtreecommitdiffstats
path: root/.github/workflows/ci.yml
blob: c76678909fcb36d297e64204aa681ba32a7aa82a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: CI
'on':
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
jobs:
  build:
    name: Build Hugo example site and archive output
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository
        uses: actions/checkout@v4

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2

      - name: Build Hugo example site
        run: |
          cd exampleSite
          hugo --verbose --baseURL= --themesDir=../../

      - name: Upload Hugo example site
        uses: actions/upload-artifact@v4
        with:
          name: hugo-example-site
          path: exampleSite/public

  lighthouse:
    name: Run Lighthouse tests against built Hugo example site
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Check out repository
        uses: actions/checkout@v4

      - name: Download Hugo example site
        uses: actions/download-artifact@v4
        with:
          name: hugo-example-site
          path: exampleSite/public

      - name: Run Lighthouse against a static dist dir
        uses: treosh/lighthouse-ci-action@v10
        with:
          configPath: ./lighthouserc.json