-
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (67 loc) · 1.68 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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: Setup task
uses: arduino/setup-task@v2
- name: Build frontend
run: task ui:build --force
- name: Lint
uses: golangci/golangci-lint-action@v4
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: Setup task
uses: arduino/setup-task@v2
- name: Build frontend
run: task ui:build --force
- 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