Skip to content
This repository was archived by the owner on May 7, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Container CI

on:
push:
tags:
- 'v*'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker tagged image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
42 changes: 42 additions & 0 deletions .github/workflows/helm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Helm CI

on:
push:
tags:
- 'v*'

env:
GCR_IMAGE: ghcr.io/rayemelyanova/diffcalc-api
HELM_VERSION: 0.1.0

jobs:
build:
name: publish gcr
runs-on: ubuntu-latest
environment: prod
steps:
- name: checkout repo
uses: actions/checkout@v2

- name: install helm
uses: Azure/setup-helm@v1

- name: login to acr using helm
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ${{ env.GCR_IMAGE }} --username ${{ github.repository_owner }} --password-stdin

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=tag


- name: package chart and push it
run: |
helm dependencies update helm/diffcalc-api
helm package helm/diffcalc-api --version ${GITHUB_REF##*/} -d /tmp/
helm push /tmp/diffcalc-api-${GITHUB_REF##*/}.tgz oci://ghcr.io/rayemelyanova/charts
76 changes: 0 additions & 76 deletions .github/workflows/images.yml

This file was deleted.

7 changes: 7 additions & 0 deletions helm/diffcalc-api/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Expand the name of the chart.
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Set the kubernetes service that diffcalc-api will use to communicate to mongo.
*/}}
{{- define "diffcalc-api.mongoUrl" }}
{{- .Values.mongodb.urlOverride | default (tpl "{{ .Release.Name }}-mongodb:27017" . ) }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
Expand Down
2 changes: 1 addition & 1 deletion helm/diffcalc-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: mongo_url
value: {{ .Values.mongodb.url }}
value: {{ include "diffcalc-api.mongoUrl" . }}
ports:
- name: http
containerPort: 8000
Expand Down
4 changes: 2 additions & 2 deletions helm/diffcalc-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
replicaCount: 1

image:
repository: gcr.io/diamond-pubreg/diffcalc/api
repository: ghcr.io/rayemelyanova/charts/diffcalc-api
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: latest
Expand Down Expand Up @@ -83,7 +83,7 @@ affinity: {}

mongodb:
enabled: true
url: diffcalc-api-mongodb:27017
urlOverride: ""
serviceAccount:
create: false
# architecture: standalone
Expand Down