Skip to content

Commit

Permalink
business microservices + aca CI piepeline first draft
Browse files Browse the repository at this point in the history
  • Loading branch information
dantelmomsft committed Jun 12, 2024
1 parent afeeec4 commit a1c513e
Show file tree
Hide file tree
Showing 141 changed files with 10,697 additions and 1,295 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/aca-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Reusable Azure Container Apps deploy
on:
workflow_call:
inputs:
env-name:
required: true
type: string
acr-name:
required: true
type: string
image-name:
required: true
type: string
container-app-name:
required: true
type: string
resource-group:
required: true
type: string


jobs:
build:
runs-on: ubuntu-latest
environment: ${{inputs.env-name}}
steps:
- name: Log in to Azure with sevice principal
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Build and deploy Container App
uses: azure/container-apps-deploy-action@v1
with:
acrName: ${{inputs.acr-name}}
containerAppName: ${{inputs.container-app-name}}
resourceGroup: ${{inputs.resource-group}}
imageToDeploy: ${{inputs.acr-name}}.azurecr.io/${{inputs.image-name}}:${{github.sha}}
40 changes: 40 additions & 0 deletions .github/workflows/acr-build-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Reusable ACR Build and Push workflow
on:
workflow_call:
inputs:
env-name:
required: true
type: string
acr-name:
required: true
type: string
image-name:
required: true
type: string
app-folder-path:
required: true
type: string


jobs:
build:
runs-on: ubuntu-latest
environment: ${{inputs.env-name}}
steps:
- name: Log in to Azure with sevice principal
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Log in Azure Container Registry
uses: azure/cli@v2
with:
azcliversion: latest
inlineScript: |
az acr login --name ${{inputs.acr-name}}
- name: Build and Push to ACR
run: |
echo "Building image [${{ inputs.image-name }}] and environment [${{ inputs.env-name }}]"
cd ${{ inputs.app-folder-path }}
docker build . -t ${{inputs.acr-name}}.azurecr.io/${{inputs.image-name}}:${{github.sha}}
docker push ${{inputs.acr-name}}.azurecr.io/${{inputs.image-name}}:${{github.sha}}
echo "image successfully pushed: ${{inputs.acr-name}}.azurecr.io/${{inputs.image-name}}:${{github.sha}}
95 changes: 0 additions & 95 deletions .github/workflows/app-ci.yaml

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/apps-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: APP CI/CD Pipeline

on:
push:
branches:
- main
paths:
- "app/**"
tags:
- v*.*.*
workflow_dispatch:

jobs:
changes-detection:
runs-on: ubuntu-latest
outputs:
env-name: ${{steps.set-deploy-env.outputs.DEPLOY_ENVIRONMENT}}
build-copilot: ${{ steps.changes.outputs.copilot }}
build-frontend: ${{ steps.changes.outputs.frontend }}
build-account-api: ${{ steps.changes.outputs.account-api }}
build-payment-api: ${{ steps.changes.outputs.payment-api }}
build-transactions-api: ${{ steps.changes.outputs.transactions-api }}
steps:
- uses: actions/checkout@v2
- name: Filter Changes
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
copilot:
- 'app/copilot/**'
frontend:
- 'app/frontend/**'
account-api:
- 'app/business-api/account/**'
payment-api:
- 'app/business-api/payment/**'
transactions-api:
- 'app/business-api/transactions-history/**'
- name: Set environment for branch
id: set-deploy-env
run: |
echo "checking branch name [${{github.ref_name}}]"
if [[ ${{github.ref_name}} == 'main' ]]; then
echo "main branch detected. Set Development environment"
echo "DEPLOY_ENVIRONMENT=Development" >> "$GITHUB_OUTPUT"
elif [[ ${{github.ref_name}} == *'release'* ]]; then
echo "release branch detected. Set Test environment"
echo "DEPLOY_ENVIRONMENT=Test" >> "$GITHUB_OUTPUT"
elif [[ ${{github.ref_name}} == *'v'* ]]; then
echo "tag detected. Set Production environment"
echo "DEPLOY_ENVIRONMENT=Production" >> "$GITHUB_OUTPUT"
else
echo "branch not detected. Set Development environment as default"
echo "DEPLOY_ENVIRONMENT=Development" >> "$GITHUB_OUTPUT"
fi
build-frontend-app:
needs: changes-detection
if : ${{ needs.changes-detection.outputs.build-frontend == 'true' }}
uses: ./.github/workflows/acr-build-push.yaml
with:
env-name: ${{ needs.changes-detection.outputs.env-name}}
acr-name: ${{ vars.AZUREACR_NAME }}
image-name: personal-finance-assistance-java/web
app-folder-path: app/frontend

98 changes: 0 additions & 98 deletions .github/workflows/nightly-jobs.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/stale-bot.yml

This file was deleted.

Binary file removed app/backend/.mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 0 additions & 2 deletions app/backend/.mvn/wrapper/maven-wrapper.properties

This file was deleted.

5 changes: 0 additions & 5 deletions app/backend/applicationinsights.json

This file was deleted.

Loading

0 comments on commit a1c513e

Please sign in to comment.