11 Commits

Author SHA1 Message Date
71c7325370 man what?
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 1m35s
Build and deploy the backend to staging / Add a comment to the PR to notify about the deployment (pull_request) Successful in 5s
Run linting on the backend code / Build (pull_request) Has been cancelled
Run testing on the backend code / Build (pull_request) Has been cancelled
2025-10-14 17:19:24 +02:00
aeed9c7dc9 maybe like this?
Some checks failed
Run testing on the backend code / Build (pull_request) Has been cancelled
Run linting on the backend code / Build (pull_request) Has been cancelled
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 2m32s
Build and deploy the backend to staging / Add a comment to the PR to notify about the deployment (pull_request) Failing after 4s
2025-10-14 17:15:07 +02:00
89c5fc9370 more tea attempts
Some checks failed
Run linting on the backend code / Build (pull_request) Has been cancelled
Run testing on the backend code / Build (pull_request) Has been cancelled
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 1m56s
Build and deploy the backend to staging / Add a comment to the PR to notify about the deployment (pull_request) Failing after 14s
2025-10-14 17:00:07 +02:00
d8c6bfcda0 try whithout body flag
Some checks failed
Run testing on the backend code / Build (pull_request) Has been cancelled
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 1m25s
Build and deploy the backend to staging / Add a comment to the PR to notify about the deployment (pull_request) Failing after 4s
Run linting on the backend code / Build (pull_request) Successful in 3m31s
2025-10-14 16:18:32 +02:00
ec3ed054fd try using the gitea cli instead
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 2m15s
Build and deploy the backend to staging / Add a comment to the PR to notify about the deployment (pull_request) Failing after 25s
Run linting on the backend code / Build (pull_request) Successful in 4m7s
Run testing on the backend code / Build (pull_request) Has been cancelled
2025-10-14 16:02:27 +02:00
219cfcf1a6 try with correct url?
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 1m49s
Build and deploy the backend to staging / Add a comment to the PR to notify about the deployment (pull_request) Failing after 21s
Run linting on the backend code / Build (pull_request) Has been cancelled
Run testing on the backend code / Build (pull_request) Has been cancelled
2025-10-14 14:50:27 +02:00
708c07cf49 add a comment containing additional deployment information
Some checks failed
Run testing on the backend code / Build (pull_request) Has been cancelled
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 2m7s
Build and deploy the backend to staging / Add a comment to the PR to notify about the deployment (pull_request) Failing after 21s
Run linting on the backend code / Build (pull_request) Successful in 3m35s
2025-10-14 14:31:56 +02:00
e14900e9f0 remove backend deployment submodule
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 2m12s
Run linting on the backend code / Build (pull_request) Successful in 1m0s
Run testing on the backend code / Build (pull_request) Failing after 23m1s
2025-10-14 11:21:28 +02:00
d1cbf972fe since branch names may contain slashes and other special chars they are not suitable for tag names. only use the hash
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 1m54s
Run linting on the backend code / Build (pull_request) Successful in 3m19s
Run testing on the backend code / Build (pull_request) Failing after 24m59s
2025-10-13 18:05:27 +02:00
fe2a0cf1d5 add missing dollar sign
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Failing after 36s
Run linting on the backend code / Build (pull_request) Successful in 2m46s
Run testing on the backend code / Build (pull_request) Has been cancelled
2025-10-13 18:03:39 +02:00
c11faee824 towards a better gitops deploy strategy
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Failing after 38s
Run linting on the backend code / Build (pull_request) Successful in 3m20s
Run testing on the backend code / Build (pull_request) Failing after 27m28s
2025-10-13 17:17:02 +02:00
11 changed files with 60 additions and 66 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use nix

View File

@@ -3,6 +3,9 @@ on:
tags:
- v*
permissions:
pull-requests: write
name: Build and deploy the backend to production
jobs:
@@ -10,15 +13,7 @@ jobs:
name: Build and push image
uses: ./.gitea/workflows/workflow_build-image.yaml
with:
tag: stable
# sets the tag to the git tag that triggered the workflow - the deployment (configured in a separate repository) will use this tag and be deployed to production by argocd
tag: ${{ github.ref_name }}
secrets:
PACKAGE_REGISTRY_ACCESS: ${{ secrets.PACKAGE_REGISTRY_ACCESS }}
deploy-prod:
name: Deploy to production
uses: ./.gitea/workflows/workflow_deploy-container.yaml
with:
overlay: prod
secrets:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
needs: build-and-push

View File

@@ -12,15 +12,32 @@ jobs:
name: Build and push image
uses: ./.gitea/workflows/workflow_build-image.yaml
with:
tag: unstable
# sets a unique tag for each commit in the PR - this gets deployed to a separate application instance using argocd
tag: sha${{ github.sha }}
secrets:
PACKAGE_REGISTRY_ACCESS: ${{ secrets.PACKAGE_REGISTRY_ACCESS }}
deploy-prod:
name: Deploy to staging
uses: ./.gitea/workflows/workflow_deploy-container.yaml
with:
overlay: stg
secrets:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
needs: build-and-push
notify:
runs-on: ubuntu-latest
name: Add a comment to the PR to notify about the deployment
steps:
- name: Download gitea client
run: |
curl -sSL -o tea https://dl.gitea.com/tea/0.11.0/tea-0.11.0-linux-amd64
chmod +x tea
- name: Login
run: |
./tea login add --url git.kluster.moll.re --name bot --token ${{ secrets.GITEA_TOKEN }}
./tea login default
- name: Post comment
run: |
./tea comment --repo anydev/anyway --login bot ${{ github.event.number }} """
The backend has been deployed to staging with url https://pr-${{ github.event.number }}.anyway-stg.anydev.info. Check the deployment status in ArgoCD:
[![App Status](https://argocd.kluster.moll.re/api/badge?name=anydev-anyway-backend-stg-pr-${{ github.event.number }}&revision=true&showAppName=true)](https://argocd.kluster.moll.re/applications/anydev-anyway-backend-stg-pr-${{ github.event.number }})
"""
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_BASE_URL: ${{ secrets.GITEA_BASE_URL }}
GITEA_REPO: ${{ secrets.GITEA_REPO }}

View File

@@ -1,35 +0,0 @@
on:
workflow_call:
inputs:
overlay:
required: true
type: string
secrets:
KUBE_CONFIG:
required: true
name: Deploy the newly built container
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: https://gitea.com/actions/checkout@v4
with:
submodules: true
- name: setup kubectl
uses: https://github.com/azure/setup-kubectl@v4
- name: Set kubeconfig
run: |
echo "${{ secrets.KUBE_CONFIG }}" > kubeconfig
- name: Deploy to k8s
run: |
kubectl apply -k backend/deployment/overlays/${{ inputs.overlay }} --kubeconfig=kubeconfig
kubectl -n anyway-backend rollout restart deployment/anyway-backend-${{ inputs.overlay }} --kubeconfig=kubeconfig

1
.gitignore vendored
View File

@@ -1 +1,2 @@
cache/
.direnv/

3
.gitmodules vendored
View File

@@ -1,3 +0,0 @@
[submodule "backend/deployment"]
path = backend/deployment
url = https://git.kluster.moll.re/anydev/anyway-backend-deployment

8
.vscode/launch.json vendored
View File

@@ -9,9 +9,7 @@
"name": "Backend - debug",
"type": "debugpy",
"request": "launch",
"env": {
"DEBUG": "true"
},
"envFile": "${workspaceFolder}/backend/debug.env",
"jinja": true,
"cwd": "${workspaceFolder}/backend",
"module": "fastapi",
@@ -25,9 +23,7 @@
"type": "debugpy",
"request": "launch",
"program": "src/tester.py",
"env": {
"DEBUG": "true"
},
"envFile": "${workspaceFolder}/backend/debug.env",
"cwd": "${workspaceFolder}/backend"
},
// frontend - flutter app

3
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"nixEnvSelector.nixFile": "${workspaceFolder}/default.nix"
}

5
backend/.gitignore vendored
View File

@@ -1,3 +1,6 @@
# all .env files
*.env
# osm-cache
cache_XML/
@@ -165,4 +168,4 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
#.idea/

17
default.nix Normal file
View File

@@ -0,0 +1,17 @@
{ pkgs ? import <nixpkgs> { config.android_sdk.accept_license = true; config.allowUnfree = true; } }:
pkgs.mkShell {
buildInputs = [
pkgs.flutter
#pkgs.android-tools # for adb
#pkgs.openjdk # required for Android builds
];
# Set up Android SDK paths if needed
shellHook = ''
export ANDROID_SDK_ROOT=${pkgs.androidsdk}/libexec/android-sdk
export PATH=$PATH:${pkgs.androidsdk}/libexec/android-sdk/platform-tools
echo "Flutter dev environment ready. 'adb' and 'flutter' are available."
'';
}