-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (58 loc) · 2.04 KB
/
ci.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
name: ci
on:
push:
branches:
- '**'
tags-ignore:
- '**'
jobs:
helm:
name: Push to the Helm Repository
runs-on: ubuntu-latest
steps:
- name: Get current time
id: date
run: echo "date=$(date +'%Y-%m-%d-%H-%M-%S')" >> $GITHUB_OUTPUT
- name: Clone
uses: actions/checkout@v4
- name: Push
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
HELM_REPO_NAME: s3://fh-eeq-helm-repository/charts
HELM_REPO_PLUGIN_NAME: https://github.com/hypnoglow/helm-s3.git
TIME: ${{ steps.date.outputs.date }}
run: |
helm version --short -c
helm plugin install $HELM_REPO_PLUGIN_NAME
helm repo add remote $HELM_REPO_NAME
helm dependency build src/prune/charts/kube-review-prune || helm dependency update charts/kube-review-prune || echo "dependencies cannot be updated"
PACKAGE="$(helm package src/prune/charts/kube-review-prune --version 0.0.1-$TIME --destination /tmp | cut -d " " -f 8)"
helm s3 push $PACKAGE remote
build:
name: Building Docker image
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
with:
push: true
tags: |
findhotelamsterdam/kube-review:${{ github.sha }}
findhotelamsterdam/kube-review:${{ env.BRANCH_NAME }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
DEFAULT_HELM_REPO_URL=s3://fh-eeq-helm-repository/charts