Skip to content

Delete CI reports after 14 days #1197

Delete CI reports after 14 days

Delete CI reports after 14 days #1197

name: Deploy to environment
on:
pull_request:
branches: [ main, '**-feature' ]
types: [ opened, synchronize, reopened]
push:
branches: [ main ]
workflow_dispatch:
inputs:
environment:
type: environment
description: "Choose an environment to deploy to"
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.event.inputs.environment }}
jobs:
set-env:
name: Determine environment
runs-on: ubuntu-22.04
outputs:
environment: ${{ steps.var.outputs.environment }}
branch: ${{ steps.var.outputs.branch }}
steps:
- id: var
run: |
GIT_REF=${{ github.ref }}
GIT_BRANCH=${GIT_REF##*/}
INPUT=${{ github.event.inputs.environment }}
ENVIRONMENT=${INPUT:-"development"}
echo "environment=${ENVIRONMENT,,}" >> $GITHUB_OUTPUT
echo "branch=$GIT_BRANCH" >> $GITHUB_OUTPUT
deploy-image:
name: Deploy to environment
needs: [ set-env ]
uses: DFE-Digital/deploy-azure-container-apps-action/.github/workflows/build-push-deploy.yml@main
with:
docker-image-name: 'fiat-app'
docker-build-file-name: 'docker/Dockerfile'
environment: ${{ needs.set-env.outputs.environment }}
secrets:
azure-acr-client-id: ${{ secrets.AZURE_ACR_CLIENTID }}
azure-acr-secret: ${{ secrets.AZURE_ACR_SECRET }}
azure-acr-url: ${{ secrets.AZURE_ACR_URL }}
azure-aca-credentials: ${{ secrets.AZURE_ACA_CREDENTIALS }}
azure-aca-name: ${{ secrets.AZURE_ACA_NAME }}
azure-aca-resource-group: ${{ secrets.AZURE_ACA_RESOURCE_GROUP }}
run-deployment-tests:
name: Run deployment tests
uses: ./.github/workflows/test-deployment.yml
needs: [ deploy-image, set-env ]
with:
environment: ${{ needs.set-env.outputs.environment }}
branch-name: ${{ needs.set-env.outputs.branch }}
secrets: inherit
run-integration-tests:
name: Run integration tests
uses: ./.github/workflows/test-integration.yml
needs: [ deploy-image, set-env ]
if: ${{ needs.set-env.outputs.environment == 'development' || needs.set-env.outputs.environment == 'test' }}
with:
environment: ${{ needs.set-env.outputs.environment }}
branch-name: ${{ needs.set-env.outputs.branch }}
secrets: inherit