Skip to content

Release to POC

Release to POC #176

name: Release to POC
on:
workflow_dispatch:
push:
branches:
- main
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
terraform-plan-and-apply-poc:
environment: POC
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: frasermolyneux/actions/terraform-plan-and-apply@main
with:
terraform-folder: "terraform"
terraform-var-file: "tfvars/poc.tfvars"
backend-subscription-id: ${{ secrets.tf_backend_subscription_id }}
backend-resource-group-name: ${{ secrets.tf_backend_resource_group_name }}
backend-storage-account-name: ${{ secrets.tf_backend_storage_account_name }}
backend-container-name: ${{ secrets.tf_backend_container_name }}
backend-key: ${{ secrets.tf_backend_key }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- id: terraform-output
shell: bash
run: |
cd terraform
echo "web_apps=$(terraform output -json web_apps)" >> $GITHUB_OUTPUT
echo "func_apps=$(terraform output -json func_apps)" >> $GITHUB_OUTPUT
echo "logic_apps=$(terraform output -json logic_apps)" >> $GITHUB_OUTPUT
echo "$(terraform output -json func_apps)"
echo "$(terraform output -json logic_apps)"
env:
ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
ARM_USE_OIDC: true
outputs:
web_apps: ${{ steps.terraform-output.outputs.web_apps }}
func_apps: ${{ steps.terraform-output.outputs.func_apps }}
logic_apps: ${{ steps.terraform-output.outputs.logic_apps }}
web-apps-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: frasermolyneux/actions/dotnet-web-ci@main
with:
dotnet-project: "web-app"
dotnet-version: 7.0.x
src-folder: "src"
func-apps-ci:
strategy:
matrix:
project: [func-app-pub, func-app-sub, func-app-bus, func-app-job]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: frasermolyneux/actions/dotnet-func-ci@main
with:
dotnet-project: ${{ matrix.project }}
dotnet-version: 6.0.x
src-folder: "src"
logic-apps-ci:
strategy:
matrix:
project: [logic-app-pub, logic-app-sub]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: frasermolyneux/actions/logic-app-ci@main
with:
logic-project: ${{ matrix.project }}
src-folder: "src"
app-service-deploy-poc:
environment: POC
runs-on: ubuntu-latest
strategy:
matrix:
web_app: ${{ fromJSON(needs.terraform-plan-and-apply-poc.outputs.web_apps) }}
needs: [web-apps-ci, terraform-plan-and-apply-poc]
steps:
- uses: actions/checkout@v3
- uses: frasermolyneux/actions/deploy-app-service@main
with:
web-artifact-name: "web-app"
web-app-name: ${{ matrix.web_app.name }}
resource-group-name: ${{ matrix.web_app.resource_group_name }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
func-app-deploy-poc:
environment: POC
runs-on: ubuntu-latest
strategy:
matrix:
func_app: ${{ fromJSON(needs.terraform-plan-and-apply-poc.outputs.func_apps) }}
needs: [func-apps-ci, terraform-plan-and-apply-poc]
steps:
- uses: actions/checkout@v3
- uses: frasermolyneux/actions/deploy-function-app@main
with:
function-app-artifact-name: "func-app-${{ matrix.func_app.role }}"
function-app-name: ${{ matrix.func_app.name }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
logic-app-deploy-poc:
environment: POC
runs-on: ubuntu-latest
strategy:
matrix:
logic_app: ${{ fromJSON(needs.terraform-plan-and-apply-poc.outputs.logic_apps) }}
needs: [logic-apps-ci, terraform-plan-and-apply-poc]
steps:
- uses: actions/checkout@v3
- uses: frasermolyneux/actions/deploy-logic-app@main
with:
logic-app-artifact-name: "logic-app-${{ matrix.logic_app.role }}"
logic-app-name: ${{ matrix.logic_app.name }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}