fix: src/package.json to reduce vulnerabilities (#23) #12
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
on: | |
push: | |
branches: | |
- main | |
env: | |
HELM_EXPERIMENTAL_OCI: 1 #enable OCI support | |
HELM_VERSION_TO_INSTALL: 3.5.0 # version of HEL to install | |
GCR_IMAGE: ghcr.io/${{ github.repository }}/pacman-helm | |
jobs: | |
build: | |
name: publish gcr | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code # Checkout source code | |
uses: 'actions/checkout@v2' | |
with: | |
ref: ${{ github.ref }} | |
fetch-depth: 0 | |
- name: Get specific changed files # To check if any files changed in charts/pacman-rancher directory | |
id: changed-files-specific | |
uses: tj-actions/changed-files@v14.5 | |
with: | |
since_last_remote_commit: true | |
files: | | |
charts/pacman-rancher/* | |
- name: install helm | |
if: steps.changed-files-specific.outputs.any_modified == 'true' | |
uses: Azure/setup-helm@v1 | |
with: | |
# Version of helm | |
version: ${{ env.HELM_VERSION_TO_INSTALL }} # default is latest # need to pin this if it works | |
- name: login to acr using helm | |
if: steps.changed-files-specific.outputs.any_modified == 'true' | |
run: | | |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ${{ env.GCR_IMAGE }} --username ${{ github.repository_owner }} --password-stdin | |
- name: save helm chart to local registry | |
if: steps.changed-files-specific.outputs.any_modified == 'true' | |
run: | | |
helm chart save ${{ github.workspace }}/charts/pacman-rancher ${{ env.GCR_IMAGE }}:${{ github.sha }} | |
- name: publish chart to gcr | |
if: steps.changed-files-specific.outputs.any_modified == 'true' | |
run: | | |
helm chart push ${{ env.GCR_IMAGE }}:${{ github.sha }} |