diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml new file mode 100644 index 0000000..3924bb4 --- /dev/null +++ b/.github/workflows/validate.yaml @@ -0,0 +1,33 @@ +name: Validate Hugo site + +on: pull_request + +defaults: + run: + shell: bash + +jobs: + build: + runs-on: ubuntu-latest + env: + HUGO_VERSION: 0.140.1 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + - name: Setup Hugo + run: | + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ + && sudo dpkg -i ${{ runner.temp }}/hugo.deb + - name: Build with Hugo + env: + HUGO_ENVIRONMENT: production + HUGO_ENV: production + run: | + hugo --gc --minify --baseURL "${{ steps.pages.outputs.base_url }}/"