diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 22b8098f..036546ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,7 +68,16 @@ jobs: egress-policy: audit - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 - - name: Publish to Registry + + - name: Login to ECR + id: ecr + uses: elgohr/ecr-login-action@v3 + with: + access_key: ${{ secrets.ECR_AWS_ACCESS_KEY }} + secret_access_key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }} + region: ${{ secrets.ECR_AWS_REGION }} + + - name: Publish to DockerHub Registry uses: elgohr/Publish-Docker-Github-Action@43dc228e327224b2eda11c8883232afd5b34943b # v5 with: name: flanksource/config-db @@ -77,6 +86,18 @@ jobs: snapshot: true dockerfile: build/Dockerfile tags: "latest,v${{ needs.semantic-release.outputs.release-version }}" + + - name: Publish to AWS ECR + uses: elgohr/Publish-Docker-Github-Action@43dc228e327224b2eda11c8883232afd5b34943b # v5 + with: + name: config-db + username: ${{ steps.ecr.outputs.username }} + password: ${{ steps.ecr.outputs.password }} + registry: ${{ steps.ecr.outputs.registry }} + snapshot: true + dockerfile: build/Dockerfile + tags: "latest,v${{ needs.semantic-release.outputs.release-version }}" + helm: runs-on: ubuntu-latest needs: [semantic-release, docker] diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index da480d31..8dcd7584 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -39,7 +39,7 @@ spec: fsGroup: 1000 containers: - name: {{ include "config-db.name" . }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: "{{ tpl .Values.global.imageRegistry . }}/{{ .Values.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} livenessProbe: failureThreshold: 3 diff --git a/chart/values.yaml b/chart/values.yaml index 06b6becd..cd0b059a 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -2,6 +2,7 @@ # Declare variables to be passed into your templates. global: + imageRegistry: docker.io/flanksource db: connectionPooler: enabled: false @@ -18,7 +19,7 @@ nameOverride: '' disablePostgrest: false image: - repository: docker.io/flanksource/config-db + name: config-db pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: 'latest'