-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (48 loc) · 2.11 KB
/
release.yml
File metadata and controls
58 lines (48 loc) · 2.11 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
name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6
- name: Get tag name
id: tag
uses: haya14busa/action-cond@d0c3785880c08a358711ee8047f593cbcf1cdcfd # haya14busa/action-cond@v1
with:
cond: "${{ startsWith(github.ref, 'refs/tags/') }}"
if_true: ${{ github.ref }}
- id: version_tag
run: |
echo "::set-output name=tag::$(echo ${{steps.tag.outputs.value}} | cut -d'v' -f2 )"
echo "::set-output name=tag_chart::$(echo ${{steps.tag.outputs.value}} | cut -d'v' -f2 )"
#Update version in Chart.yaml
- if: steps.tag.outputs.value != ''
run: |
sed -i '/^version:/c\version: ${{steps.version_tag.outputs.tag_chart}}' ./helm/tracker/Chart.yaml
sed -i '/^appVersion:/c\appVersion: "${{steps.version_tag.outputs.tag_chart}}"' ./helm/tracker/Chart.yaml
- if: steps.tag.outputs.value != ''
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # stefanzweifel/git-auto-commit-action@v7
with:
commit_message: "ci: bump charts to ${{steps.version_tag.outputs.tag}}"
branch: main
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # docker/login-action@v3
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{ secrets.DOCKER_AUTH_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # docker/build-push-action@v5
with:
context: .
push: true
tags: |
bananaops/tracker:latest
bananaops/tracker:${{steps.version_tag.outputs.tag}}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64