File tree Expand file tree Collapse file tree 9 files changed +93
-13
lines changed Expand file tree Collapse file tree 9 files changed +93
-13
lines changed Original file line number Diff line number Diff line change 1
1
name : basic-check
2
2
3
3
on :
4
- push :
5
- branches :
6
- - master
7
- pull_request :
8
- branches :
9
- - ' **'
4
+ workflow_call :
10
5
11
6
jobs :
12
7
check :
35
30
- name : end-of-file-check
36
31
uses : njgibbon/fend@main
37
32
33
+ - uses : azure/setup-helm@v3
34
+ with :
35
+ version : ' v3.14.0'
36
+ id : install
37
+
38
+ - name : Helm lint
39
+ run : |
40
+ helm lint --strict chart
41
+
38
42
- name : Lint
39
43
run : |
40
44
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -d -b $(go env GOPATH)/bin v1.55.1
Original file line number Diff line number Diff line change
1
+ name : test
2
+
3
+ on :
4
+ workflow_call :
5
+ secrets :
6
+ DOCKERHUB_USERNAME :
7
+ required : true
8
+ DOCKERHUB_TOKEN :
9
+ required : true
10
+ KUBECONTENT :
11
+ required : true
12
+ jobs :
13
+ deployment :
14
+ if : ${{ startsWith(github.ref, 'refs/heads/deployment/') || github.ref == 'refs/heads/main' }}
15
+ runs-on : [self-hosted]
16
+ steps :
17
+ - uses : actions/checkout@v4
18
+
19
+ - name : Set up Go
20
+ uses : actions/setup-go@v4
21
+ with :
22
+ go-version : ' 1.20.9'
23
+ cache : true
24
+
25
+ - name : install deps
26
+ run : |
27
+ sudo apt-get update
28
+ sudo apt-get -o Acquire::Retries=3 install make gcc git curl wget -y
29
+
30
+ - name : Build
31
+ env :
32
+ GOPROXY : " https://proxy.golang.org,direct"
33
+ GO111MODULE : " on"
34
+ run : |
35
+ make build
36
+
37
+ - name : Get version
38
+ id : version
39
+ run : |
40
+ if [[ -n "$GITHUB_REF" && "$GITHUB_REF" == "refs/tags/"* ]]; then
41
+ echo "tag version"
42
+ echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}"
43
+ else
44
+ echo "commit version"
45
+ echo "::set-output name=version::${{ github.sha }}"
46
+ fi
47
+
48
+ - name : Build and push
49
+ run : |
50
+ docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
51
+ make docker TAG=${{ steps.version.outputs.version }}
52
+
53
+ - name : Deploy
54
+ uses : WyriHaximus/github-action-helm3@v3
55
+ with :
56
+ exec : helm upgrade jiaozifs-api --install ./chart --wait --atomic --timeout 2m --namespace jiaozifs --set-string log_level=debug --set-string db='${{secrets.DBURL}}' --set-string tag=${{ steps.version.outputs.version }}
57
+ kubeconfig : ${{ secrets.KUBECONTENT }}
58
+ overrule_existing_kubeconfig : " true"
Original file line number Diff line number Diff line change
1
+ name : test
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ - ' deployment/**'
8
+ pull_request :
9
+ branches :
10
+ - ' **'
11
+
12
+ jobs :
13
+ check :
14
+ uses : ./.github/workflows/basic_check.yml
15
+ test :
16
+ uses : ./.github/workflows/test.yml
17
+ deployment :
18
+ needs :
19
+ - test
20
+ - check
21
+ uses : ./.github/workflows/deployment.yml
22
+ secrets : inherit
Original file line number Diff line number Diff line change 1
1
name : test
2
2
3
3
on :
4
- push :
5
- branches :
6
- - master
7
- pull_request :
8
- branches :
9
- - ' **'
4
+ workflow_call :
10
5
11
6
jobs :
12
7
test :
File renamed without changes.
Original file line number Diff line number Diff line change 17
17
spec :
18
18
containers :
19
19
- name : jiaozifs-backend
20
- image : gitdatateam/jzfs:latest
20
+ image : gitdatateam/jzfs:{{ .Values.tag }}
21
21
imagePullPolicy : Always
22
22
args : ["--db {{ .Values.db }} --log-level {{ .Values.log_level }} --bs_path {{ .Values.home_path }}/data --listen http://0.0.0.0:{{ .Values.port }} --config {{ .Values.home_path }}/config.yaml"]
23
23
ports :
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -8,3 +8,4 @@ port: 34913
8
8
ingress_name : nginx
9
9
log_level : info
10
10
claim_name : jiaozifs-home
11
+ tag : latest
You can’t perform that action at this time.
0 commit comments