-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (64 loc) · 2.57 KB
/
build-n-publish.yml
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
name: Push image to JFROG Public
on:
push:
branches:
- 'main'
permissions:
id-token: write
contents: read
jobs:
build-operator:
name: Build and Push Operator Docker Images
uses: truefoundry/github-workflows-public/.github/workflows/[email protected]
with:
image_tag: ${{ github.sha }}
image_artifact_name: 'elasti-operator'
dockerfile_path: 'operator/Dockerfile'
artifactory_registry_url: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_REGISTRY_URL }}
artifactory_repository_url: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_REPOSITORY }}
secrets:
artifactory_username: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_USERNAME }}
artifactory_password: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_PASSWORD }}
build-resolver:
name: Build and Push Resolver Docker Images
uses: truefoundry/github-workflows-public/.github/workflows/[email protected]
with:
image_tag: ${{ github.sha }}
image_artifact_name: 'elasti-resolver'
dockerfile_path: 'resolver/Dockerfile'
artifactory_registry_url: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_REGISTRY_URL }}
artifactory_repository_url: ${{ vars.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_REPOSITORY }}
secrets:
artifactory_username: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_USERNAME }}
artifactory_password: ${{ secrets.TRUEFOUNDRY_ARTIFACTORY_PUBLIC_PASSWORD }}
# We are updating the sha in the helm chart values.yaml file on the helm-main branch
update-helm-chart:
name: Update Helm values.yaml
runs-on: ubuntu-latest
permissions:
contents: write
needs: [build-operator, build-resolver]
steps:
- name: Checkout helm-main branch
uses: actions/checkout@v4
with:
fetch-depth: "0"
ref: helm-main
- name: Fetch main branch
run: git fetch origin main:main
- name: Sync charts from main
run: |
# Removing charts directory and copying fresh from main
git fetch origin main:main
rm -rf charts/
git checkout main -- charts/
- name: Update Helm values.yaml
run: |
cd charts/elasti
yq -i '.elastiController.manager.image.tag="${{ github.sha }}"' values.yaml
yq -i '.elastiResolver.proxy.image.tag="${{ github.sha }}"' values.yaml
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git add values.yaml
git commit -m "Update Helm values.yaml on helm-main branch with sha: ${{ github.sha }}" --signoff
git push --force origin helm-main