diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1e40ff4b..0442569e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -5,4 +5,4 @@ ENV PYTHONUNBUFFERED 1 RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends postgresql-client \ - && apt-get clean -y && rm -rf /var/lib/apt/lists/* \ No newline at end of file + && apt-get clean -y && rm -rf /var/lib/apt/lists/* diff --git a/.github/workflows/testittfft-ixhict44-ca-AutoDeployTrigger-8fa7ae9d-10d9-43e2-b63c-bfe97742caaf.yml b/.github/workflows/testittfft-ixhict44-ca-AutoDeployTrigger-8fa7ae9d-10d9-43e2-b63c-bfe97742caaf.yml new file mode 100644 index 00000000..ce1e6b44 --- /dev/null +++ b/.github/workflows/testittfft-ixhict44-ca-AutoDeployTrigger-8fa7ae9d-10d9-43e2-b63c-bfe97742caaf.yml @@ -0,0 +1,48 @@ +name: Trigger auto deployment for testittfft-ixhict44-ca + +# When this action will be executed +on: + # Automatically trigger it when detected changes in repo + push: + branches: + [ main ] + paths: + - '**' + - '.github/workflows/testittfft-ixhict44-ca-AutoDeployTrigger-8fa7ae9d-10d9-43e2-b63c-bfe97742caaf.yml' + + # Allow manual trigger + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + permissions: + id-token: write #This is required for requesting the OIDC JWT Token + contents: read #Required when GH token is used to authenticate with private repo + + steps: + - name: Checkout to the branch + uses: actions/checkout@v2 + + - name: Azure Login + uses: azure/login@v1 + with: + client-id: ${{ secrets.TESTITTFFTIXHICT44CA_AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.TESTITTFFTIXHICT44CA_AZURE_TENANT_ID }} + subscription-id: ${{ secrets.TESTITTFFTIXHICT44CA_AZURE_SUBSCRIPTION_ID }} + + - name: Build and push container image to registry + uses: azure/container-apps-deploy-action@v2 + with: + appSourcePath: ${{ github.workspace }} + _dockerfilePathKey_: _dockerfilePath_ + registryUrl: testittfftixhict44koeberegistry.azurecr.io + registryUsername: ${{ secrets.TESTITTFFTIXHICT44CA_REGISTRY_USERNAME }} + registryPassword: ${{ secrets.TESTITTFFTIXHICT44CA_REGISTRY_PASSWORD }} + containerAppName: testittfft-ixhict44-ca + resourceGroup: ResourceGroup1 + imageToBuild: testittfftixhict44koeberegistry.azurecr.io/testittfft-ixhict44-ca:${{ github.sha }} + _buildArgumentsKey_: | + _buildArgumentsValues_ + + diff --git a/infra/main.bicep b/infra/main.bicep index 58f4db04..aaede3be 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -9,6 +9,10 @@ param name string @description('Primary location for all resources') param location string +@description('Name of the existing resource group to use') +@minLength(1) +param existingResourceGroupName string + @description('Whether the deployment is running on GitHub Actions') param runningOnGh string = '' @@ -87,10 +91,9 @@ var resourceToken = toLower(uniqueString(subscription().id, name, location)) var prefix = '${name}-${resourceToken}' var tags = { 'azd-env-name': name } -resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { - name: '${name}-rg' - location: location - tags: tags +// Use the existing resource group +resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' existing = { + name: existingResourceGroupName } var postgresServerName = '${prefix}-postgresql'