Skip to content

Commit

Permalink
chore: add ecr push action (#624)
Browse files Browse the repository at this point in the history
* chore: add ecr push action

* chore: template image repository in chart

* chore: add image name in chart

* chore: address review comments

* chore: address review comments
  • Loading branch information
yashmehrotra authored Jun 11, 2024
1 parent 7087561 commit efda080
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Declare variables to be passed into your templates.

global:
imageRegistry: docker.io/flanksource
db:
connectionPooler:
enabled: false
Expand All @@ -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'
Expand Down

0 comments on commit efda080

Please sign in to comment.