Initial commit #4
This file contains 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: | |
workflow_dispatch: | |
push: | |
concurrency: | |
group: ${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
GO111MODULE: "on" | |
CGO_ENABLED: "0" | |
GOTOOLCHAIN: auto # fix Go toolchain version mismatch | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- name: Lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: latest | |
only-new-issues: true | |
skip-pkg-cache: true | |
snapshot: | |
name: Build snapshot Docker image | |
runs-on: ubuntu-latest | |
needs: [ lint] | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- name: Install ko | |
uses: imjasonh/[email protected] | |
- name: Build and push snapshot Docker image | |
env: | |
KO_DOCKER_REPO: ghcr.io/skynewz/gh-stars-search-engine | |
run: | | |
ko build \ | |
--bare \ | |
--platform=linux/amd64,linux/arm64 \ | |
--preserve-import-paths=false \ | |
--sbom=none |