Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b209a8e
feat: Scaffold Notifications module structure
estebankt Nov 30, 2025
a804bca
fix: fix build errors in VS
estebankt Nov 30, 2025
da85bfd
feat: Implement Notifications module and fix build issues
estebankt Nov 30, 2025
085261d
feat: Implement Analytics module scaffolding and TransactionCreatedEv…
estebankt Nov 30, 2025
3f72fbb
feat: Implement in-memory domain event dispatching mechanism
estebankt Nov 30, 2025
d4748c8
feat: Implement TransactionUpdatedEvent and TransactionDeletedEvent h…
estebankt Nov 30, 2025
ff8c4e4
feat: Implement Analytics API and Monthly Summary Query
estebankt Nov 30, 2025
88d9f49
fixed documentations typo
estebankt Nov 30, 2025
44da464
feat: Finalize production readiness and cleanup
estebankt Dec 1, 2025
a6be45d
feat: Add flexible authentication support for testing and production
estebankt Dec 1, 2025
4dd792d
feat: Add API tests and bash test scripts for comprehensive testing
estebankt Dec 1, 2025
dabecb7
docs: Add comprehensive test infrastructure status document
estebankt Dec 1, 2025
3a2b254
feat: Add pgAdmin to docker-compose for database management
estebankt Dec 1, 2025
b57451a
ci: Add Azure deployment pipeline infrastructure
estebankt Dec 1, 2025
b8ef081
docs: Update tasks.md to reflect completed modules and deployment pip…
estebankt Dec 1, 2025
2abeb99
fix: small formatting fixes
estebankt Dec 1, 2025
70a14c8
fix: removed unused clases and added documentation
estebankt Dec 2, 2025
cc47281
feat: Add system categories support with read-only global categories
estebankt Dec 4, 2025
270555e
feat: Add database resilience and global exception handling
estebankt Dec 6, 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
181 changes: 181 additions & 0 deletions .github/workflows/azure-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# GitHub Actions Workflow for SpendBear API
# Builds, tests, and deploys to Azure App Service

name: Deploy to Azure

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
workflow_dispatch: # Manual trigger

env:
DOTNET_VERSION: '10.x'
AZURE_WEBAPP_NAME: 'spendbear-api' # Update with your Azure Web App name
AZURE_WEBAPP_PACKAGE_PATH: './publish'

jobs:
build-and-test:
name: Build and Test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore dependencies
run: dotnet restore

- name: Build solution
run: dotnet build --configuration Release --no-restore

- name: Run unit tests
run: |
dotnet test \
--configuration Release \
--no-build \
--logger trx \
--collect:"XPlat Code Coverage" \
--results-directory ./TestResults \
--filter "FullyQualifiedName~Domain|Application"

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: ./TestResults

- name: Publish API
run: |
dotnet publish src/Api/SpendBear.Api/SpendBear.Api.csproj \
--configuration Release \
--no-build \
--output ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

- name: Upload artifact for deployment
uses: actions/upload-artifact@v4
with:
name: api-package
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

deploy-dev:
name: Deploy to Development
needs: build-and-test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
environment:
name: Development
url: https://${{ env.AZURE_WEBAPP_NAME }}-dev.azurewebsites.net

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: api-package
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

- name: Deploy to Azure Web App (Dev)
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}-dev
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_DEV }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

- name: Smoke test
run: |
sleep 10
curl -f https://${{ env.AZURE_WEBAPP_NAME }}-dev.azurewebsites.net/health || exit 1
echo "✅ Development deployment successful!"

deploy-staging:
name: Deploy to Staging
needs: build-and-test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
environment:
name: Staging
url: https://${{ env.AZURE_WEBAPP_NAME }}-staging.azurewebsites.net

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: api-package
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

- name: Deploy to Azure Web App (Staging)
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}-staging
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_STAGING }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

- name: Smoke test
run: |
sleep 10
curl -f https://${{ env.AZURE_WEBAPP_NAME }}-staging.azurewebsites.net/health || exit 1
echo "✅ Staging deployment successful!"

- name: Run API tests against staging
run: |
# TODO: Add bash script tests against staging environment
echo "Running API tests..."

deploy-production:
name: Deploy to Production
needs: deploy-staging
runs-on: ubuntu-latest
environment:
name: Production
url: https://${{ env.AZURE_WEBAPP_NAME }}.azurewebsites.net

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: api-package
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

- name: Deploy to Azure Web App (Production)
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

- name: Smoke test
run: |
sleep 10
curl -f https://${{ env.AZURE_WEBAPP_NAME }}.azurewebsites.net/health || exit 1
echo "✅ Production deployment successful!"

- name: Create release tag
if: success()
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
TAG="v$(date +'%Y.%m.%d')-$(git rev-parse --short HEAD)"
git tag -a $TAG -m "Production release $TAG"
git push origin $TAG
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Deployment summary
run: |
echo "### 🎉 Deployment Successful!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Environment:** Production" >> $GITHUB_STEP_SUMMARY
echo "**URL:** https://${{ env.AZURE_WEBAPP_NAME }}.azurewebsites.net" >> $GITHUB_STEP_SUMMARY
echo "**Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
echo "**Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
Loading
Loading