-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (65 loc) · 1.95 KB
/
docker-helm.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
name: Build and Push Docker Image with Buildx and Push Helm Chart
on:
push:
branches:
- master
- dev
tags:
- '*'
workflow_dispatch:
jobs:
docker:
runs-on: ${{ vars.RUNNER_SCALE_SET }}
steps:
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ${{ vars.DOCKER_REGISTRY }}
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ vars.DOCKER_REGISTRY }}/${{ vars.DOCKER_PROJECT }}/${{ vars.DOCKER_IMAGE }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
charts: |
type=semver,pattern={{version}}
- name: Build and Push Docker image
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
helm:
if: github.ref_type == 'tag'
runs-on: ${{ vars.RUNNER_SCALE_SET }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
tags: |
type=semver,pattern={{version}}
flavor: |
latest=false
- name: Install Helm
uses: azure/[email protected]
- name: Push Helm Chart
uses: appany/[email protected]
with:
name: ${{ vars.DOCKER_IMAGE }}
repository: charts
tag: ${{ steps.meta.outputs.tags }}
path: deploy/chart
registry: ${{ vars.DOCKER_REGISTRY }}
registry_username: ${{ vars.DOCKER_USERNAME }}
registry_password: ${{ secrets.DOCKER_PASSWORD }}