feat: add Helm chart and switch image builds to DOCR
All checks were successful
CI / ci (pull_request) Successful in 18s
CI / e2e (pull_request) Successful in 1m1s

- Add chart/ with backend, frontend, valkey deployments, services, and ingress
- Update nginx.conf to use BACKEND_URL env var via envsubst
- Update Dockerfile.frontend to use nginx template mechanism
- Build.yml: switch Docker registry from Gitea to DOCR, add helm package+push step
This commit is contained in:
Ryan Moon
2026-04-03 18:53:46 -05:00
parent 0e3a8d7504
commit 1601e0f849
13 changed files with 285 additions and 20 deletions

View File

@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, 'chore: bump version')"
env:
REGISTRY: git2.lunarfront.tech
REGISTRY: registry.digitalocean.com/lunarfront
GIT_REMOTE: git2.lunarfront.tech
DOCKER_HOST: tcp://localhost:2375
@@ -53,8 +53,8 @@ jobs:
")
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Login to registry
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login $REGISTRY -u ryan --password-stdin
- name: Login to DOCR
run: echo "${{ secrets.DOCR_TOKEN }}" | docker login registry.digitalocean.com -u token --password-stdin
- name: Build and push backend
run: |
@@ -62,26 +62,42 @@ jobs:
SHA=$(git rev-parse --short HEAD)
docker build \
--build-arg APP_VERSION=$VERSION \
-t $REGISTRY/ryan/lunarfront-app:$VERSION \
-t $REGISTRY/ryan/lunarfront-app:$SHA \
-t $REGISTRY/ryan/lunarfront-app:latest \
-t $REGISTRY/lunarfront-app:$VERSION \
-t $REGISTRY/lunarfront-app:$SHA \
-t $REGISTRY/lunarfront-app:latest \
-f Dockerfile .
docker push $REGISTRY/ryan/lunarfront-app:$VERSION
docker push $REGISTRY/ryan/lunarfront-app:$SHA
docker push $REGISTRY/ryan/lunarfront-app:latest
docker push $REGISTRY/lunarfront-app:$VERSION
docker push $REGISTRY/lunarfront-app:$SHA
docker push $REGISTRY/lunarfront-app:latest
- name: Build and push frontend
run: |
VERSION=${{ steps.version.outputs.version }}
SHA=$(git rev-parse --short HEAD)
docker build \
-t $REGISTRY/ryan/lunarfront-frontend:$VERSION \
-t $REGISTRY/ryan/lunarfront-frontend:$SHA \
-t $REGISTRY/ryan/lunarfront-frontend:latest \
-t $REGISTRY/lunarfront-frontend:$VERSION \
-t $REGISTRY/lunarfront-frontend:$SHA \
-t $REGISTRY/lunarfront-frontend:latest \
-f Dockerfile.frontend .
docker push $REGISTRY/ryan/lunarfront-frontend:$VERSION
docker push $REGISTRY/ryan/lunarfront-frontend:$SHA
docker push $REGISTRY/ryan/lunarfront-frontend:latest
docker push $REGISTRY/lunarfront-frontend:$VERSION
docker push $REGISTRY/lunarfront-frontend:$SHA
docker push $REGISTRY/lunarfront-frontend:latest
- name: Install Helm
run: |
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- name: Package and push Helm chart
run: |
VERSION=${{ steps.version.outputs.version }}
# Update chart version to match app version
sed -i "s/^version:.*/version: $VERSION/" chart/Chart.yaml
sed -i "s/^appVersion:.*/appVersion: \"$VERSION\"/" chart/Chart.yaml
# Update default image tags in values.yaml to this version
sed -i "s|tag: latest|tag: $VERSION|g" chart/values.yaml
helm registry login registry.digitalocean.com -u token --password "${{ secrets.DOCR_TOKEN }}"
helm package chart/
helm push lunarfront-$VERSION.tgz oci://registry.digitalocean.com/lunarfront
- name: Commit version bump
run: |
@@ -95,4 +111,4 @@ jobs:
- name: Logout
if: always()
run: docker logout $REGISTRY
run: docker logout registry.digitalocean.com