Merge pull request #4 from qrkourier/pages #23
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: CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| go: | |
| name: Go build & test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - name: Build | |
| run: go build -o sitegen . | |
| - name: Test | |
| run: go test -v -race -count=1 ./... | |
| lint-go: | |
| name: golangci-lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - uses: golangci/golangci-lint-action@v7 | |
| with: | |
| version: v2.10.1 | |
| lint-yaml: | |
| name: yamllint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install yamllint | |
| run: pip install yamllint | |
| - name: Lint YAML | |
| run: yamllint -d relaxed .github/ compose.yaml compose.dev.yaml compose.watchtower.yaml deploy/ | |
| lint-dockerfile: | |
| name: hadolint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: hadolint/hadolint-action@v3.1.0 | |
| with: | |
| dockerfile: Dockerfile | |
| failure-threshold: warning | |
| validate-k8s: | |
| name: Validate Kubernetes manifests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install kubeconform | |
| run: | | |
| curl -fsSL https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz \ | |
| | tar xz -C /usr/local/bin | |
| - name: Validate manifests | |
| run: kubeconform -strict -summary -ignore-filename-pattern 'kustomization' deploy/kubernetes/ | |
| docker: | |
| name: Docker build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Build image (no push) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: false | |
| tags: sitegen:ci | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |