Merge pull request #509 from zlabjp/add-more-linters #1261
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 | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| tags: | |
| - v[0-9]+.[0-9]+.[0-9]+ | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.24' | |
| - uses: golangci/golangci-lint-action@v9 | |
| - name: Build | |
| run: | | |
| make vet check controller | |
| - name: Resolve image properties | |
| uses: actions/github-script@v8 | |
| id: imageprops | |
| with: | |
| script: | | |
| core.setOutput('push', '${{ github.ref_type }}' == 'tag' || '${{ github.ref_name }}' == 'main') | |
| core.setOutput('tag', '${{ github.ref_type }}' == 'tag' ? '${{ github.ref_name }}' : 'latest') | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| if: steps.imageprops.outputs.push == 'true' | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build container image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: ${{ steps.imageprops.outputs.push == 'true' }} | |
| tags: ghcr.io/zlabjp/nghttpx-ingress-controller:${{ steps.imageprops.outputs.tag }} | |
| provenance: false |