Skip to content

Merge pull request #38 from hazelops/CORE-610-autoscaling-implemented… #11

Merge pull request #38 from hazelops/CORE-610-autoscaling-implemented…

Merge pull request #38 from hazelops/CORE-610-autoscaling-implemented… #11

name: Push Web Helm Chart To Public ECR
defaults:
run:
shell: bash
env:
AWS_REGION: us-east-1
ECR_REPO_NAME: web
CHART_PATH: ./charts/web
ECR_PUBLIC_REPO_ALIAS: o2d6g3h3
on:
push:
branches:
- develop
paths:
- 'charts/**'
release:
types: [published, created]
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }}
aws-region: ${{ env.AWS_REGION }}
- name: Create AWS ECR Public Repository
shell: bash
run: |
aws ecr-public describe-repositories --repository-names ${{ env.ECR_REPO_NAME }} || aws ecr-public create-repository --repository-name ${{ env.ECR_REPO_NAME }}
- name: Install PyBump
run: |
python3 -m pip install pybump
shell: bash
- name: Install Helm 3.12
uses: azure/setup-helm@v3
with:
version: 'v3.12.2'
- name: Helm Chart Release
env:
HELM_EXPERIMENTAL_OCI: 1
run: |
helm version
version=$(pybump get --file ${{ env.CHART_PATH }}/Chart.yaml)
helm package ${{ env.CHART_PATH }} --app-version $version --version $version
aws ecr-public get-login-password --region ${{ env.AWS_REGION }} | helm registry login --username AWS --password-stdin public.ecr.aws
echo pushing $(basename ${{ env.CHART_PATH }})-$version.tgz to oci://public.ecr.aws/${{ env.ECR_PUBLIC_REPO_ALIAS }}
helm push --debug $(basename ${{ env.CHART_PATH }})-$version.tgz oci://public.ecr.aws/${{ env.ECR_PUBLIC_REPO_ALIAS }}
shell: bash