feat: publish pgsql.cc documentation portal #1
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 Deploy pgsql.cc | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: pages-${{ github.ref }} | |
| cancel-in-progress: false | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| GO_VERSION: 1.26.6 | |
| HUGO_VERSION: 0.164.0 | |
| GOWORK: off | |
| HUGO_MODULE_WORKSPACE: off | |
| jobs: | |
| build: | |
| name: Check and build site | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pages: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: true | |
| - name: Install Hugo Extended | |
| run: | | |
| curl --fail --location --silent --show-error \ | |
| --output "${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: Download OINK module | |
| run: go mod download github.com/pgsty/oink | |
| - name: Check site | |
| env: | |
| HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache | |
| HUGO_ENVIRONMENT: production | |
| HUGO_ENV: production | |
| run: make check | |
| - name: Configure GitHub Pages | |
| if: github.ref == 'refs/heads/main' | |
| id: pages | |
| uses: actions/configure-pages@v6 | |
| - name: Build Pages artifact | |
| if: github.ref == 'refs/heads/main' | |
| env: | |
| HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache | |
| HUGO_ENVIRONMENT: production | |
| HUGO_ENV: production | |
| run: | | |
| hugo --cleanDestinationDir --gc --minify --panicOnWarning \ | |
| --printPathWarnings --baseURL "${{ steps.pages.outputs.base_url }}/" | |
| - name: Upload Pages artifact | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: public | |
| deploy: | |
| name: Deploy GitHub Pages | |
| if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: github-pages | |
| cancel-in-progress: false | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |