Skip to content

Commit

Permalink
Try to update helm versionning
Browse files Browse the repository at this point in the history
  • Loading branch information
Matlavv committed Nov 19, 2024
1 parent 69ac4cf commit 52a4337
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
fi
echo "Latest tag: $latest_tag"
echo "tag=$latest_tag" >> $GITHUB_ENV
- name: Determine next version
id: set_output
run: |
Expand Down Expand Up @@ -56,15 +57,25 @@ jobs:
echo "New version: $new_version"
echo "new_version=$new_version" >> $GITHUB_ENV
echo "new_version=$new_version" >> $GITHUB_OUTPUT
- name: Update Helm chart version
run: |
sed -i "s/version:.*/version: ${{ steps.set_output.outputs.new_version }}/" ${{ env.CHART_PATH }}/Chart.yaml
- name: Create and push new tag
sed -i "s/^version:.*/version: ${{ steps.set_output.outputs.new_version }}/" ${{ env.CHART_PATH }}/Chart.yaml
sed -i "s/^appVersion:.*/appVersion: '${{ steps.set_output.outputs.new_version }}'/" ${{ env.CHART_PATH }}/Chart.yaml
- name: Commit updated Helm chart version
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git add ${{ env.CHART_PATH }}/Chart.yaml
git commit -m "Update Helm chart version to ${{ steps.set_output.outputs.new_version }}"
git push origin HEAD:${{ github.head_ref }} # Push changes to the current branch
- name: Create and push new tag
run: |
git tag ${{ steps.set_output.outputs.new_version }}
git push origin ${{ steps.set_output.outputs.new_version }}
build-and-push-docker-api:
runs-on: ubuntu-latest
needs: determine-version
Expand All @@ -80,6 +91,7 @@ jobs:
key: ${{ runner.os }}-api-node-modules-${{ hashFiles('src/api/package-lock.json') }}
restore-keys: |
${{ runner.os }}-api-node-modules-
- name: Install npm dependencies for API
working-directory: src/api
run: npm install
Expand All @@ -96,6 +108,7 @@ jobs:
key: ${{ runner.os }}-buildx-${{ hashFiles('src/api/Dockerfile', 'src/api/.dockerignore') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ hashFiles('src/api/Dockerfile', 'src/api/.dockerignore') }}-
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -105,6 +118,7 @@ jobs:
- name: Build and push Docker image API
run: |
docker buildx build --platform linux/amd64,linux/arm64 --push -t ${{ env.IMAGE_NAME }}:api-${{ needs.determine-version.outputs.new_version }} --cache-from=type=local,src=/tmp/.buildx-cache --cache-to=type=local,dest=/tmp/.buildx-cache,mode=max ./src/api
build-and-push-docker-job:
runs-on: ubuntu-latest
needs: determine-version
Expand All @@ -125,6 +139,7 @@ jobs:
key: ${{ runner.os }}-buildx-${{ hashFiles('src/Dockerfile', 'src/.dockerignore') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ hashFiles('src/Dockerfile', 'src/.dockerignore') }}-
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -134,6 +149,7 @@ jobs:
- name: Build and push Docker image Job
run: |
docker buildx build --platform linux/amd64,linux/arm64 --push -t ${{ env.IMAGE_NAME }}:job-${{ needs.determine-version.outputs.new_version }} --cache-from=type=local,src=/tmp/.buildx-cache --cache-to=type=local,dest=/tmp/.buildx-cache,mode=max ./src
publish-helm-chart:
runs-on: ubuntu-latest
needs:
Expand All @@ -160,7 +176,8 @@ jobs:

- name: Package Helm chart
run: |
helm package opensource
helm package ${{ env.CHART_PATH }}
- name: Push Helm chart to Docker Hub
run: |
helm push $(ls *.tgz) oci://registry-1.docker.io/amelieloulou

0 comments on commit 52a4337

Please sign in to comment.