update-helm-chart #525
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update chart image tags | |
on: | |
repository_dispatch: | |
types: [update-helm-chart] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Install yq | |
run: sudo snap install yq | |
- name: Update dashboard image tag | |
if: ${{ github.event.client_payload.dashboard_tag }} | |
run: yq e '.services.dashboard.image.tag = "${{ github.event.client_payload.dashboard_tag }}"' -i cryptlex/cryptlex-enterprise/values.yaml | |
- name: Update web api image tag | |
if: ${{ github.event.client_payload.web_api_tag }} | |
run: yq e '.services.webApi.image.tag = "${{ github.event.client_payload.web_api_tag }}"' -i cryptlex/cryptlex-enterprise/values.yaml | |
- name: Update release server image tag | |
if: ${{ github.event.client_payload.release_server_tag }} | |
run: yq e '.services.releaseServer.image.tag = "${{ github.event.client_payload.release_server_tag }}"' -i cryptlex/cryptlex-enterprise/values.yaml | |
- name: Get current chart version | |
id: chartVersion | |
run: echo "##[set-output name=version;]$(yq e '.version' cryptlex/cryptlex-enterprise/Chart.yaml)" | |
- name: Get next minor version | |
id: semvers | |
uses: "WyriHaximus/github-action-next-semvers@v1" | |
with: | |
version: ${{ steps.chartVersion.outputs.version }} | |
- name: Update chart version | |
run: | | |
yq e '.version = "${{ steps.semvers.outputs.patch }}"' -i cryptlex/cryptlex-enterprise/Chart.yaml | |
yq e '.appVersion = "${{ steps.semvers.outputs.patch }}"' -i cryptlex/cryptlex-enterprise/Chart.yaml | |
- name: Commit files | |
run: | | |
git add ./cryptlex/cryptlex-enterprise/*.yaml | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit -m "Updated images" -a | exit 0 | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.REPO_ACCESS_TOKEN }} |