forked from cert-manager/webhook-example
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (85 loc) · 2.23 KB
/
ci.yaml
File metadata and controls
101 lines (85 loc) · 2.23 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI
on:
push:
branches:
- master
tags:
- "v*.*.*"
pull_request:
branches:
- master
permissions:
contents: read
packages: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25"
cache: true
- name: Run go vet
run: go vet ./...
- name: Run tests
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.txt
fail_ci_if_error: false
verbose: true
helm-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.16.0
- name: Lint Helm Chart
run: |
helm lint deploy/cert-manager-alidns-webhook
docker-release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [test, helm-lint]
uses: ./.github/workflows/docker-release.yaml
secrets: inherit
permissions:
contents: write
packages: write
id-token: write
helm-release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [test, helm-lint]
uses: ./.github/workflows/helm-release.yaml
secrets: inherit
permissions:
contents: write
packages: write
id-token: write
create-release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [docker-release, helm-release]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body: |
## Docker Image
```bash
docker pull ghcr.io/crazygit/cert-manager-alidns-webhook:${{ github.ref_name }}
```
## Helm Chart
```bash
helm install cert-manager-alidns-webhook oci://ghcr.io/crazygit/helm-charts/cert-manager-alidns-webhook --version ${{ github.ref_name }}
```
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}