Skip to content

Commit

Permalink
Test to update helm chart version
Browse files Browse the repository at this point in the history
  • Loading branch information
Matlavv committed Nov 19, 2024
1 parent 394265d commit ad87788
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
24 changes: 3 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ 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 @@ -57,26 +56,15 @@ 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
sed -i "s/^appVersion:.*/appVersion: '${{ steps.set_output.outputs.new_version }}'/" ${{ env.CHART_PATH }}/Chart.yaml
- name: Commit updated Helm chart version
sed -i "s/version:.*/version: ${{ steps.set_output.outputs.new_version }}/" ${{ env.CHART_PATH }}/Chart.yaml
- name: Create and push new tag
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 }}"
current_branch=$(git rev-parse --abbrev-ref HEAD)
git push origin $current_branch # 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 @@ -92,7 +80,6 @@ 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 @@ -109,7 +96,6 @@ 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 @@ -119,7 +105,6 @@ 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 @@ -140,7 +125,6 @@ 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 @@ -150,7 +134,6 @@ 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 @@ -177,8 +160,7 @@ jobs:

- name: Package Helm chart
run: |
helm package ${{ env.CHART_PATH }}
helm package opensource
- name: Push Helm chart to Docker Hub
run: |
helm push $(ls *.tgz) oci://registry-1.docker.io/amelieloulou
4 changes: 2 additions & 2 deletions opensource/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: transform-and-deliver-assets
description: TADA 🎉 - Transform And Deliver Assets - Bouygues Telecom
type: application
version: 0.0.2-beta
appVersion: '0.0.1'
version: 0.0.3-beta
appVersion: '0.0.1'

0 comments on commit ad87788

Please sign in to comment.