88env :
99 DOCKERHUB_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
1010 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
11+ IMAGE : stono/kconmon
1112
1213jobs :
14+ config :
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - name : Set env
19+ run : echo ::set-env name=VERSION::${GITHUB_REF#refs/*/}
20+
1321 docker :
22+ needs : config
1423 runs-on : ubuntu-latest
1524
1625 steps :
@@ -23,54 +32,54 @@ jobs:
2332 - name : Log into registry
2433 run : echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u stono --password-stdin
2534
26- - name : Push image
27- run : |
28- IMAGE=stono/kconmon
35+ - name : Push 0.0.0 image
36+ run : docker-compose push
37+
38+ helm :
39+ needs : config
40+ runs-on : ubuntu-latest
2941
30- # Strip git ref prefix from version
31- VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
42+ steps :
43+ - name : Checkout code
44+ uses : actions/checkout@v2
3245
33- # Strip "v" prefix from tag name
34- [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
46+ - name : Package Helm
47+ run : |
48+ cd ./helmfile/charts/kconmon
49+ helm package --version=$VERSION .
50+ mv kconmon*.tgz kconmon-chart.tgz
3551
36- docker tag $IMAGE:latest $IMAGE:$VERSION
37- docker push $IMAGE:$VERSION
52+ - name : Upload the helm chart
53+ uses : actions/upload-artifact@v1
54+ with :
55+ name : helm-chart
56+ path : ./helmfile/charts/kconmon/kconmon-chart.tgz
3857
3958 release :
40- needs : docker
59+ needs :
60+ - docker
61+ - helm
4162 runs-on : ubuntu-latest
4263
4364 steps :
4465 - name : Create Release
4566 id : create_release
4667 uses : actions/create-release@v1
4768 with :
48- tag_name : ${{ github.ref }}
49- release_name : Release ${{ github.ref }}
50- draft : false
51- prerelease : false
52-
53- helm :
54- needs : release
55- runs-on : ubuntu-latest
56-
57- steps :
58- - name : Checkout code
59- uses : actions/checkout@v2
69+ tag_name : latest
70+ release_name : Latest
71+ draft : true
6072
61- - name : Package Helm
62- run : |
63- wget --quiet https://get.helm.sh/helm-v2.16.9-linux-amd64.tar.gz
64- tar xf helm-v2.16.9-linux-amd64.tar.gz
65- cd ./helmfile/charts/kconmon
66- ../../../linux-amd64/helm package .
67- mv kconmon*.tgz kconmon-chart.tgz
73+ - name : Download helm chart
74+ uses : actions/download-artifact@v1
75+ with :
76+ name : helm-chart
6877
6978 - name : Upload Release Asset
7079 id : upload-release-asset
7180 uses : actions/upload-release-asset@v1
7281 with :
7382 upload_url : ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
74- asset_path : ./helmfile/charts/kconmon /kconmon-chart.tgz
75- asset_name : kconmon -chart.tgz
83+ asset_path : ./helm-chart /kconmon-chart.tgz
84+ asset_name : helm -chart.tgz
7685 asset_content_type : application/gzip
0 commit comments