Skip to content

Commit dbd1f76

Browse files
committed
fix: combine wf
1 parent 933857c commit dbd1f76

File tree

3 files changed

+49
-80
lines changed

3 files changed

+49
-80
lines changed

.github/workflows/publish-charts.yaml

Lines changed: 0 additions & 62 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ jobs:
135135
uses: docker/metadata-action@v5
136136
with:
137137
images: ghcr.io/${{ github.repository }}/${{ matrix.project }}
138-
tags: |
139-
latest
140-
${{ github.sha }}
138+
tags: ${{ github.sha }}
141139

142140
- name: Build and push Docker image
143141
uses: docker/build-push-action@v5
@@ -151,22 +149,56 @@ jobs:
151149
cache-from: type=gha
152150
cache-to: type=gha,mode=max
153151

154-
trigger-helm-release:
152+
release-charts:
155153
needs: [identify-changed-projects, build-and-push]
156154
if: needs.identify-changed-projects.outputs.operator_changed == 'true'
155+
permissions:
156+
contents: write
157157
runs-on: ubuntu-latest
158158
steps:
159-
- name: Update Helm Chart Values
160-
uses: actions/github-script@v7
159+
- name: Checkout
160+
uses: actions/checkout@v4
161+
with:
162+
fetch-depth: 0
163+
164+
- name: Configure Git
165+
run: |
166+
git config user.name "$GITHUB_ACTOR"
167+
git config user.email "[email protected]"
168+
169+
- name: Update Chart Values
170+
run: |
171+
# Update the operator image tag in values.yaml
172+
sed -i "s/tag: .*/tag: ${{ github.sha }}/" k8s/charts/orc/values.yaml
173+
174+
# Commit and push changes
175+
git add k8s/charts/orc/values.yaml
176+
git commit -m "chore: update operator image tag to ${{ github.sha }}"
177+
git push
178+
179+
- name: Install Helm
180+
uses: azure/setup-helm@v4
181+
env:
182+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
183+
184+
- name: Add repositories
185+
run: |
186+
for dir in $(ls -d k8s/charts/*/); do
187+
helm dependency list $dir 2> /dev/null | tail +2 | head -n -1 | awk '{ print "helm repo add " $1 " " $3 }' | while read cmd; do $cmd; done
188+
done
189+
190+
- name: Build chart dependencies
191+
run: |
192+
for dir in k8s/charts/*/
193+
do
194+
(cd ${dir}; helm dependency build)
195+
done
196+
197+
- name: Run chart-releaser
198+
uses: helm/[email protected]
161199
with:
162-
github-token: ${{ secrets.GITHUB_TOKEN }}
163-
script: |
164-
await github.rest.actions.createWorkflowDispatch({
165-
owner: context.repo.owner,
166-
repo: context.repo.name,
167-
workflow_id: 'release-charts.yml',
168-
ref: context.ref,
169-
inputs: {
170-
operator_version: '${{ github.sha }}'
171-
}
172-
});
200+
charts_dir: k8s/charts
201+
config: './.github/configs/cr.yaml'
202+
env:
203+
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
204+
CR_SKIP_EXISTING: true

apps/operator/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ FROM node:22-alpine3.20 AS runtime
1414

1515
WORKDIR /app
1616

17-
# Copy the build artifacts and node_modules from the builder stage
1817
COPY --from=builder /app/dist/apps/operator ./operator
1918
COPY --from=builder /app/node_modules ./node_modules
2019

0 commit comments

Comments
 (0)