Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
167 commits
Select commit Hold shift + click to select a range
d50ef15
start branch dev
vrtornisiello May 13, 2025
5eb8e00
add helm files
vrtornisiello May 13, 2025
4dd2215
add release and deploy workflows
vrtornisiello May 13, 2025
ee35444
removed irrelevant information from home page and also removed exampl…
vrtornisiello May 13, 2025
51c1764
home page and disclaimer adjustments
vrtornisiello May 14, 2025
b256c2b
changed ingress host and path
vrtornisiello May 20, 2025
1c7c10f
fixing port and path
vrtornisiello May 20, 2025
a6353b5
fix api service host and port
vrtornisiello May 20, 2025
80fa7f2
edit home page
vrtornisiello May 20, 2025
4d7fb49
remove unused code
vrtornisiello May 20, 2025
4ffcb1d
add empty volume for logging
vrtornisiello May 20, 2025
cd044c6
Merge pull request #2 from basedosdados/add_deploy_files
vrtornisiello May 20, 2025
90e4e9d
using a ghcr-qualified name
vrtornisiello May 20, 2025
6a7a3c2
Merge pull request #3 from basedosdados/fix-release-action
vrtornisiello May 20, 2025
0f5af2f
allow manual execution of the dev deploy action
vrtornisiello May 20, 2025
bde4bdf
Merge pull request #4 from basedosdados/update-deploy-action
vrtornisiello May 20, 2025
38e8fc8
Merge pull request #5 from basedosdados/dev
vrtornisiello May 20, 2025
4311956
downgrade google-github-actions actions
vrtornisiello May 20, 2025
131277e
Merge pull request #6 from basedosdados/fix-deploy-action
vrtornisiello May 20, 2025
1a891ac
fix parsing error in Helm templates
vrtornisiello May 20, 2025
9477b6c
Merge pull request #7 from basedosdados/fix-helm-templates
vrtornisiello May 20, 2025
8c12a0e
update namespace
vrtornisiello May 20, 2025
b173cc7
fix variable path
vrtornisiello May 20, 2025
af75434
Merge pull request #8 from basedosdados/fix-deploy-helm-templates
vrtornisiello May 20, 2025
ac839c4
Merge pull request #9 from basedosdados/dev
vrtornisiello May 20, 2025
26b5c7f
fix variable path
vrtornisiello May 20, 2025
7f0fdeb
fix ingress annotations
vrtornisiello May 20, 2025
5938dfb
Merge pull request #10 from basedosdados/dev
vrtornisiello May 20, 2025
5ec0e11
fix namespace name
vrtornisiello May 20, 2025
0f1bc97
Merge pull request #11 from basedosdados/fix-deploy-action-again
vrtornisiello May 20, 2025
30d91cf
Merge pull request #12 from basedosdados/dev
vrtornisiello May 20, 2025
8dd52cd
expose streamlit port
vrtornisiello May 21, 2025
493c372
enable verbose output
vrtornisiello May 21, 2025
38fb444
Merge pull request #13 from basedosdados/dev
vrtornisiello May 21, 2025
51a4cf2
switch from username to email
vrtornisiello May 21, 2025
76cf937
Merge pull request #14 from basedosdados/update_ui
vrtornisiello May 21, 2025
14fff34
escape `$` because of github actions
vrtornisiello May 21, 2025
62cdcc6
Merge pull request #15 from basedosdados/dev
vrtornisiello May 21, 2025
12a1633
escape the dollar sign
vrtornisiello May 21, 2025
1161c1c
enclosing the EOF delimiter in double quotes, which prevents any vari…
vrtornisiello May 21, 2025
2c648ba
trying single quotes
vrtornisiello May 21, 2025
acbcb7b
fix ingress annotations
vrtornisiello May 21, 2025
4abe198
trying to quote the cert-manager issuer
vrtornisiello May 21, 2025
72ee5f1
quoting everything
vrtornisiello May 21, 2025
557fc4a
trying to use a correct rewrite-target
vrtornisiello May 21, 2025
e3237b9
trying to remove the trailing slash
vrtornisiello May 21, 2025
e5fdfc8
quoting everything again
vrtornisiello May 21, 2025
eb03e46
trying to use the `quote` function
vrtornisiello May 21, 2025
0f0ef61
deploying streamlit at root path
vrtornisiello May 21, 2025
425f6d8
trying to use quotes in the values.yaml file
vrtornisiello May 21, 2025
c7d012e
using `ImplementationSpecific` path type and setting `nginx` using `i…
vrtornisiello May 21, 2025
dd5d2f3
update default `values.yaml` file
vrtornisiello May 21, 2025
5d8abaa
Merge pull request #16 from basedosdados/main
vrtornisiello May 21, 2025
260f7f9
trying to redirect `/chatbot` to `/chatbot/`
vrtornisiello May 21, 2025
56ab2db
adds liveness probe and changes probes paths to `/_stcore/health`
vrtornisiello May 21, 2025
006de49
Merge pull request #17 from basedosdados/main
vrtornisiello May 21, 2025
f632289
add support to multiple chats
vrtornisiello Jul 1, 2025
faa0f1e
filtered deleted threads and repositioned the "New Chat" button
vrtornisiello Jul 2, 2025
7ba2fa5
change endpoint
vrtornisiello Jul 4, 2025
1e13e76
improve docstrings and return `Thread` object
vrtornisiello Jul 7, 2025
2784f3d
minor styling changes
vrtornisiello Jul 7, 2025
9436682
minor styling changes
vrtornisiello Jul 7, 2025
236def9
changed message listing endpoint
vrtornisiello Jul 7, 2025
5e5f520
ordering threads and messages by creation datetime
vrtornisiello Jul 7, 2025
ec49286
handling threads with no title
vrtornisiello Jul 7, 2025
34bda57
remove `deleted` field
vrtornisiello Jul 14, 2025
a73ef2f
create logout page and other minor styling changes
vrtornisiello Jul 14, 2025
5018375
replace `conversations` with `chat_pages`
vrtornisiello Jul 14, 2025
b89c917
add chat delete confirmation
vrtornisiello Jul 15, 2025
f049e43
refactor loop: reduce indentation
vrtornisiello Jul 15, 2025
584f3c3
use streamlit native page navigation
vrtornisiello Jul 16, 2025
7ef5836
remove chart-related components
vrtornisiello Jul 16, 2025
22e81e7
add chat deletion button
vrtornisiello Jul 18, 2025
3d79da3
update the app "about" page
vrtornisiello Jul 18, 2025
e7a8ef7
make `title` a required field in the `Thread` model
vrtornisiello Jul 18, 2025
b2dfb5d
handle thread creation error
vrtornisiello Jul 18, 2025
f59f8db
move login page creation to the `else` block
vrtornisiello Jul 18, 2025
6cd7107
removed `url_path` parameter from the default page, as it is ignored …
vrtornisiello Jul 18, 2025
19aaff6
use `str()` instead of f-strings
vrtornisiello Jul 18, 2025
139abb5
Merge pull request #18 from basedosdados/feat/multi-chat-nav
vrtornisiello Jul 18, 2025
bbb5a12
enable chat deletion on threads with no messages
vrtornisiello Jul 18, 2025
52e59e6
Merge pull request #19 from basedosdados/fix/chat-deletion-button
vrtornisiello Jul 18, 2025
0bd1181
check for thread creation error only on thread creation
vrtornisiello Jul 18, 2025
034ed42
Merge pull request #20 from basedosdados/fix/thread-creation-check
vrtornisiello Jul 18, 2025
16f86af
update dependencies
vrtornisiello Jul 18, 2025
b94971f
add response streaming support
vrtornisiello Jul 18, 2025
3a425d9
add chat deletion confirmation modal
vrtornisiello Jul 18, 2025
56a00e1
create `safe_steps` property in the `Step` model
vrtornisiello Jul 18, 2025
03165bc
bugfix: fix endpoint and add default values to `MessagePair` model fi…
vrtornisiello Jul 18, 2025
e9fa186
bugfix: ensure a single "new chat" page
vrtornisiello Jul 21, 2025
056365f
minor refactor and update docstrings
vrtornisiello Jul 21, 2025
7d11976
checking for `assistant_message` instead of `error_message`
vrtornisiello Jul 21, 2025
70e4b03
update comments
vrtornisiello Jul 22, 2025
ccefd07
fix: `API_HOST` and `API_PORT` constants
vrtornisiello Jul 22, 2025
7a15f6d
Merge pull request #21 from basedosdados/feat/stream-responses
vrtornisiello Jul 24, 2025
b2e56ba
change initial status message
vrtornisiello Jul 25, 2025
00d9ef7
add safeguard for silent stream termination
vrtornisiello Jul 25, 2025
1843f1b
redirect to chatbot-streamlit
rdahis Aug 5, 2025
35e7820
Merge branch 'main' into dev
rdahis Aug 5, 2025
bd4a884
update deploy workflow to use new `/chatbot-streamlit` path
vrtornisiello Aug 5, 2025
81257ad
update `Dockerfile` to use poetry
vrtornisiello Aug 5, 2025
635bed2
install poetry with installation script
vrtornisiello Aug 5, 2025
61b6711
change color palette
vrtornisiello Aug 15, 2025
0d196dd
Merge pull request #24 from basedosdados/style/bd-color-palette
vrtornisiello Aug 18, 2025
c7ed946
fix typewriter effect color
vrtornisiello Aug 18, 2025
2a00e11
chore: update chat page to handle new streaming data
vrtornisiello Aug 18, 2025
afb79bf
refactor: create helper method
vrtornisiello Aug 18, 2025
15d1d6c
Merge pull request #25 from basedosdados/chore/handle-new-streaming
vrtornisiello Aug 18, 2025
4c3dbb8
refactor message streaming
vrtornisiello Aug 27, 2025
e2e12f4
style: isort
vrtornisiello Aug 27, 2025
66d494f
refactor message streaming
vrtornisiello Aug 28, 2025
22efbdf
removed code button, fixed tool args formatting
vrtornisiello Aug 28, 2025
ef216c5
show initials as human avatar
vrtornisiello Aug 28, 2025
fd81222
fix: show initials as human avatar
vrtornisiello Aug 28, 2025
63320f4
increase timeout for thread deletion
vrtornisiello Aug 29, 2025
cfc971f
cleaned `MessagePair` model
vrtornisiello Aug 29, 2025
6c62033
make `events` a required field
vrtornisiello Sep 1, 2025
b4c2eab
show empty answer correctly
vrtornisiello Sep 1, 2025
fb8cf04
stream a `complete` event on exceptions
vrtornisiello Sep 1, 2025
23dfc8b
Merge pull request #26 from basedosdados/refactor/react-agent
vrtornisiello Sep 1, 2025
25e2a9e
remove code button docs from the `about` page
vrtornisiello Sep 2, 2025
fd00dd5
format sql queries before displaying
vrtornisiello Sep 2, 2025
afe38f8
update `streamlit` to version `1.49.0` (latest)
vrtornisiello Sep 2, 2025
93fc91c
check if assistant message is strictly not `None`
vrtornisiello Sep 3, 2025
d1b9051
Merge pull request #27 from basedosdados/chore/ui-adjustments
vrtornisiello Sep 4, 2025
6117b4d
set `toolbarMode` to minimal
vrtornisiello Sep 5, 2025
4072acb
Merge pull request #28 from basedosdados/chore/remove-streamlit-toolbar
vrtornisiello Sep 5, 2025
49d67aa
tell user when the response is truncated
vrtornisiello Sep 10, 2025
34961dd
Merge pull request #29 from basedosdados/feat/info-partial-results
vrtornisiello Sep 11, 2025
64c7a37
adjust "about" page
vrtornisiello Sep 19, 2025
3cd5d03
replace feedback text box with a feedback dialog
vrtornisiello Sep 19, 2025
741dd68
use list instead of tuple in `st.columns`
vrtornisiello Sep 22, 2025
3c354be
style: right-align buttons in feedback dialog
vrtornisiello Sep 22, 2025
ec7d27f
update log message
vrtornisiello Sep 23, 2025
a78685e
create `feedback_clicked_key` class attribute
vrtornisiello Sep 23, 2025
ec1914e
reposition feedback error message
vrtornisiello Sep 23, 2025
ffe02c1
Merge pull request #30 from basedosdados/refactor/feedback-sending
vrtornisiello Sep 23, 2025
8fb9c60
escape currency symbols for markdown rendering
vrtornisiello Sep 26, 2025
55a2047
update warning log message
vrtornisiello Sep 26, 2025
b8d43d3
Merge pull request #31 from basedosdados/feat/escape-currencies
vrtornisiello Sep 26, 2025
9711cf1
change colors for improved visibility in light theme
vrtornisiello Oct 23, 2025
26fe4a7
display permanent status container only when tool calls are present
vrtornisiello Oct 23, 2025
e0f3d90
Merge pull request #34 from basedosdados/chore/ui-improvements
vrtornisiello Oct 28, 2025
7bb89ce
chore(k8s): reduce CPU requests and limits
vrtornisiello Oct 28, 2025
7d23498
fix: syntax warning on docstring
vrtornisiello Oct 28, 2025
7c137d0
chore: allow manual workflow dispatch
vrtornisiello Oct 28, 2025
a310dad
Merge pull request #36 from basedosdados/chore/manual-workflow-dispatch
vrtornisiello Oct 28, 2025
5424643
refactor: create constants from env variables
vrtornisiello Nov 26, 2025
204a5ae
chore: log only to stdout
vrtornisiello Nov 26, 2025
8c48291
chore: update dependencies
vrtornisiello Nov 26, 2025
f06110c
chore: create example .env file
vrtornisiello Nov 26, 2025
5f6ad1c
update README.md
vrtornisiello Nov 26, 2025
d58dbed
k8s: remove ephemeral volume, logs will be logged to stdout
vrtornisiello Nov 26, 2025
22b7f08
k8s: create env variables in the container
vrtornisiello Nov 26, 2025
7b817f1
style: run isort
vrtornisiello Nov 26, 2025
5594060
style: update `values.yaml`
vrtornisiello Dec 10, 2025
22eb2f6
Merge pull request #38 from basedosdados/add-env-variables
vrtornisiello Dec 10, 2025
8b439b9
chore: add release and deploy actions for staging environment
vrtornisiello Dec 11, 2025
b78aaf6
chore: add release and deploy actions for production environment
vrtornisiello Dec 11, 2025
d7dd8cd
Merge pull request #41 from basedosdados/chore/prepare-for-staging-an…
vrtornisiello Dec 11, 2025
10d0a4f
feat: add token refresh mechanism in `APIClient`
vrtornisiello Dec 12, 2025
f2a9d62
feat: add refresh token to all api calls
vrtornisiello Dec 12, 2025
6777a39
chore: update dependencies
vrtornisiello Dec 12, 2025
df631b8
feat: add session expired warnings to the ui
vrtornisiello Dec 12, 2025
05f5f34
refactor: append to chat history after context manager
vrtornisiello Dec 12, 2025
542a192
chore: update method docstring
vrtornisiello Dec 12, 2025
e072657
Merge pull request #42 from basedosdados/feat/refresh-tokens
vrtornisiello Dec 12, 2025
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
17 changes: 17 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Backend API host and port
API_HOST=localhost
API_PORT=8000

# Log level
LOG_LEVEL=DEBUG

# Whether the full stacktrace should be shown when logging exceptions.
LOG_BACKTRACE=true

# Whether exception traces should display the variables values,
# for debugging. Should be se to False in production.
LOG_DIAGNOSE=false

# Whether the messages to be logged should first pass through
# a multiprocessing-safe queue before reaching the sink.
LOG_ENQUEUE=true
108 changes: 108 additions & 0 deletions .github/workflows/deploy-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Deploy Development Docker Container

on:
workflow_run:
workflows:
- "Release Development Docker Image"
branches:
- dev
types:
- completed
workflow_dispatch:

jobs:
deploy-dev:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
environment:
name: development
url: https://development.basedosdados.org

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: dev

- name: Import Secrets
id: import_secrets
uses: hashicorp/vault-action@v3
with:
url: https://vault.basedosdados.org
token: ${{ secrets.VAULT_TOKEN }}
secrets: |
secret/data/gcp_credentials/basedosdados-dev GCP_SA_KEY_BASE64 | GCP_SA_KEY_BASE64;
secret/data/gcp_credentials/basedosdados-dev GCP_PROJECT_ID | GCP_PROJECT_ID;
secret/data/gcp_credentials/basedosdados-dev GKE_CLUSTER_NAME | GKE_CLUSTER_NAME;
secret/data/gcp_credentials/basedosdados-dev GKE_CLUSTER_ZONE | GKE_CLUSTER_ZONE;

- name: Setup Google Cloud CLI
uses: google-github-actions/[email protected]
with:
service_account_key: ${{ steps.import_secrets.outputs.GCP_SA_KEY_BASE64 }}
project_id: ${{ steps.import_secrets.outputs.GCP_PROJECT_ID }}
export_default_credentials: true

- name: Get GKE credentials
uses: google-github-actions/[email protected]
with:
cluster_name: ${{ steps.import_secrets.outputs.GKE_CLUSTER_NAME }}
location: ${{ steps.import_secrets.outputs.GKE_CLUSTER_ZONE }}
credentials: ${{ steps.import_secrets.outputs.GCP_SA_KEY_BASE64 }}

- name: Write values.yaml file
run: |
cat << 'EOF' > values.yaml
chatbotFrontend:
name: basedosdados-chatbot-frontend-dev
image:
name: ghcr.io/${{ github.repository }}
tag: dev
pullPolicy: Always
env:
API_HOST: api-development-service
API_PORT: 80
LOG_LEVEL: INFO
LOG_BACKTRACE: true
LOG_DIAGNOSE: false
LOG_ENQUEUE: true
replicas: 1
resources:
requests:
cpu: 250m
memory: 500Mi
limits:
cpu: 500m
memory: 1Gi
ingress:
enabled: true
host: development.basedosdados.org
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/ssl-redirect: "true"
cert-manager.io/issuer: letsencrypt-production
nginx.ingress.kubernetes.io/configuration-snippet: |
# Redirect exact /chatbot-streamlit → /chatbot-streamlit/ with a 301
rewrite ^/chatbot-streamlit$ /chatbot-streamlit/ permanent;
tls:
- hosts:
- development.basedosdados.org
secretName: development-basedosdados-org-tls
EOF

- name: Validate values.yaml file
run: |
echo "Generated values.yaml content:"
cat values.yaml
echo "Validating YAML syntax:"
python3 -c "import yaml; yaml.safe_load(open('values.yaml'))"

- name: Deploy using Helm
run: |
helm upgrade \
--install basedosdados-chatbot-frontend-dev charts/basedosdados-chatbot-frontend/. \
--namespace website \
--values values.yaml \
--debug \
--wait
108 changes: 108 additions & 0 deletions .github/workflows/deploy-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Deploy Production Docker Container

on:
workflow_run:
workflows:
- "Release Production Docker Image"
branches:
- main
types:
- completed
workflow_dispatch:

jobs:
deploy-prod:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
environment:
name: production
url: https://basedosdados.org

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main

- name: Import Secrets
id: import_secrets
uses: hashicorp/vault-action@v3
with:
url: https://vault.basedosdados.org
token: ${{ secrets.VAULT_TOKEN }}
secrets: |
secret/data/gcp_credentials/basedosdados-dev GCP_SA_KEY_BASE64 | GCP_SA_KEY_BASE64;
secret/data/gcp_credentials/basedosdados-dev GCP_PROJECT_ID | GCP_PROJECT_ID;
secret/data/gcp_credentials/basedosdados-dev GKE_CLUSTER_NAME | GKE_CLUSTER_NAME;
secret/data/gcp_credentials/basedosdados-dev GKE_CLUSTER_ZONE | GKE_CLUSTER_ZONE;

- name: Setup Google Cloud CLI
uses: google-github-actions/[email protected]
with:
service_account_key: ${{ steps.import_secrets.outputs.GCP_SA_KEY_BASE64 }}
project_id: ${{ steps.import_secrets.outputs.GCP_PROJECT_ID }}
export_default_credentials: true

- name: Get GKE credentials
uses: google-github-actions/[email protected]
with:
cluster_name: ${{ steps.import_secrets.outputs.GKE_CLUSTER_NAME }}
location: ${{ steps.import_secrets.outputs.GKE_CLUSTER_ZONE }}
credentials: ${{ steps.import_secrets.outputs.GCP_SA_KEY_BASE64 }}

- name: Write values.yaml file
run: |
cat << 'EOF' > values.yaml
chatbotFrontend:
name: basedosdados-chatbot-frontend-prod
image:
name: ghcr.io/${{ github.repository }}
tag: prod
pullPolicy: Always
env:
API_HOST: api-prod-service
API_PORT: 80
LOG_LEVEL: INFO
LOG_BACKTRACE: true
LOG_DIAGNOSE: false
LOG_ENQUEUE: true
replicas: 1
resources:
requests:
cpu: 250m
memory: 500Mi
limits:
cpu: 500m
memory: 1Gi
ingress:
enabled: true
host: basedosdados.org
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/ssl-redirect: "true"
cert-manager.io/issuer: letsencrypt-production
nginx.ingress.kubernetes.io/configuration-snippet: |
# Redirect exact /chatbot-streamlit → /chatbot-streamlit/ with a 301
rewrite ^/chatbot-streamlit$ /chatbot-streamlit/ permanent;
tls:
- hosts:
- basedosdados.org
secretName: basedosdados-org-tls
EOF

- name: Validate values.yaml file
run: |
echo "Generated values.yaml content:"
cat values.yaml
echo "Validating YAML syntax:"
python3 -c "import yaml; yaml.safe_load(open('values.yaml'))"

- name: Deploy using Helm
run: |
helm upgrade \
--install basedosdados-chatbot-frontend-prod charts/basedosdados-chatbot-frontend/. \
--namespace website \
--values values.yaml \
--debug \
--wait
108 changes: 108 additions & 0 deletions .github/workflows/deploy-staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Deploy Staging Docker Container

on:
workflow_run:
workflows:
- "Release Staging Docker Image"
branches:
- staging
types:
- completed
workflow_dispatch:

jobs:
deploy-staging:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
environment:
name: staging
url: https://staging.basedosdados.org

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: staging

- name: Import Secrets
id: import_secrets
uses: hashicorp/vault-action@v3
with:
url: https://vault.basedosdados.org
token: ${{ secrets.VAULT_TOKEN }}
secrets: |
secret/data/gcp_credentials/basedosdados-dev GCP_SA_KEY_BASE64 | GCP_SA_KEY_BASE64;
secret/data/gcp_credentials/basedosdados-dev GCP_PROJECT_ID | GCP_PROJECT_ID;
secret/data/gcp_credentials/basedosdados-dev GKE_CLUSTER_NAME | GKE_CLUSTER_NAME;
secret/data/gcp_credentials/basedosdados-dev GKE_CLUSTER_ZONE | GKE_CLUSTER_ZONE;

- name: Setup Google Cloud CLI
uses: google-github-actions/[email protected]
with:
service_account_key: ${{ steps.import_secrets.outputs.GCP_SA_KEY_BASE64 }}
project_id: ${{ steps.import_secrets.outputs.GCP_PROJECT_ID }}
export_default_credentials: true

- name: Get GKE credentials
uses: google-github-actions/[email protected]
with:
cluster_name: ${{ steps.import_secrets.outputs.GKE_CLUSTER_NAME }}
location: ${{ steps.import_secrets.outputs.GKE_CLUSTER_ZONE }}
credentials: ${{ steps.import_secrets.outputs.GCP_SA_KEY_BASE64 }}

- name: Write values.yaml file
run: |
cat << 'EOF' > values.yaml
chatbotFrontend:
name: basedosdados-chatbot-frontend-staging
image:
name: ghcr.io/${{ github.repository }}
tag: staging
pullPolicy: Always
env:
API_HOST: api-staging-service
API_PORT: 80
LOG_LEVEL: INFO
LOG_BACKTRACE: true
LOG_DIAGNOSE: false
LOG_ENQUEUE: true
replicas: 1
resources:
requests:
cpu: 250m
memory: 500Mi
limits:
cpu: 500m
memory: 1Gi
ingress:
enabled: true
host: staging.basedosdados.org
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/ssl-redirect: "true"
cert-manager.io/issuer: letsencrypt-production
nginx.ingress.kubernetes.io/configuration-snippet: |
# Redirect exact /chatbot-streamlit → /chatbot-streamlit/ with a 301
rewrite ^/chatbot-streamlit$ /chatbot-streamlit/ permanent;
tls:
- hosts:
- staging.basedosdados.org
secretName: staging-basedosdados-org-tls
EOF

- name: Validate values.yaml file
run: |
echo "Generated values.yaml content:"
cat values.yaml
echo "Validating YAML syntax:"
python3 -c "import yaml; yaml.safe_load(open('values.yaml'))"

- name: Deploy using Helm
run: |
helm upgrade \
--install basedosdados-chatbot-frontend-staging charts/basedosdados-chatbot-frontend/. \
--namespace website \
--values values.yaml \
--debug \
--wait
32 changes: 32 additions & 0 deletions .github/workflows/release-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release Development Docker Image

on:
push:
branches: dev
workflow_dispatch:

jobs:
release-dev:
name: Release dev docker image
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: dev

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}:dev
Loading