feat: add production environment variables and update Gitea workflow for deployment
All checks were successful
Main Build & Deploy / Build and Push Docker Image (amd64 and arm64) (push) Successful in 2m59s
Main Build & Deploy / Deploy Live (push) Successful in 5s

This commit is contained in:
José Henrique 2025-02-16 11:47:28 -03:00
parent 1f2a71452b
commit 2487076e92
4 changed files with 16 additions and 3 deletions

7
.env.production Normal file
View File

@ -0,0 +1,7 @@
VITE_FIREBASE_API_KEY=VITE_FIREBASE_API_KEY
VITE_FIREBASE_AUTH_DOMAIN=VITE_FIREBASE_AUTH_DOMAIN
VITE_FIREBASE_PROJECT_ID=VITE_FIREBASE_PROJECT_ID
VITE_FIREBASE_STORAGE_BUCKET=VITE_FIREBASE_STORAGE_BUCKET
VITE_FIREBASE_MESSAGING_SENDER_ID=VITE_FIREBASE_MESSAGING_SENDER_ID
VITE_FIREBASE_APP_ID=VITE_FIREBASE_APP_ID
VITE_FIREBASE_MEASUREMENT_ID=VITE_FIREBASE_MEASUREMENT_ID

View File

@ -1,6 +1,9 @@
name: Main Build & Deploy name: Main Build & Deploy
on: workflow_dispatch on:
push:
branches:
- main
jobs: jobs:
build: build:
@ -41,6 +44,9 @@ jobs:
name: Deploy Live name: Deploy Live
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
environment:
name: production
url: https://pet.ivanch.me # adjust this URL as needed
steps: steps:
- name: Recreate container - name: Recreate container

2
env.sh
View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
for i in $(env | grep MY_APP_) for i in $(env | grep VITE_)
do do
key=$(echo $i | cut -d '=' -f 1) key=$(echo $i | cut -d '=' -f 1)
value=$(echo $i | cut -d '=' -f 2-) value=$(echo $i | cut -d '=' -f 2-)

View File

@ -2,7 +2,7 @@ import { ApiConfig } from './types';
// API configuration // API configuration
export const apiConfig: ApiConfig = { export const apiConfig: ApiConfig = {
baseURL: import.meta.env.VITE_API_BASE_URL || 'http://localhost:5278', baseURL: import.meta.env.VITE_API_BASE_URL || 'VITE_API_BASE_URL',
timeout: 10000, // 10 seconds timeout: 10000, // 10 seconds
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',