-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
business microservices + aca CI piepeline first draft
- Loading branch information
1 parent
afeeec4
commit a1c513e
Showing
141 changed files
with
10,697 additions
and
1,295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.