Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add separated environments for deployments #1

Merged
merged 2 commits into from
Mar 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 46 additions & 30 deletions .github/workflows/deploy-resource-group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,57 @@ permissions:
id-token: write
contents: read
jobs:
deploy:
deploy-dev:
environment: dev
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main

- name: Checkout code
uses: actions/checkout@main
- name: Log into Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
enable-AzPSSession: true

- name: Log into Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
enable-AzPSSession: true
- name: Deploy DEV resource group
uses: azure/powershell@v1
with:
inlineScript: |
$ParamsDev = @{
TemplateFilePath = "./src/infra/resourceGroup.bicep"
TemplateParameterFilePath = "./src/infra/resourceGroup.dev.bicepparam"
}

- name: Deploy DEV resource group
uses: azure/powershell@v1
with:
inlineScript: |
$ParamsDev = @{
TemplateFilePath = "./src/infra/resourceGroup.bicep"
TemplateParameterFilePath = "./src/infra/resourceGroup.dev.bicepparam"
}
./src/scripts/Deploy-ToSubscription.ps1 @ParamsDev
azPSVersion: "11.4.0"

./src/scripts/Deploy-ToSubscription.ps1 @ParamsDev
azPSVersion: "11.4.0"
deploy-prd:
environment: prd
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main

- name: Log into Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
enable-AzPSSession: true

- name: Deploy PROD resource group
uses: azure/powershell@v1
with:
inlineScript: |
$ParamsProd = @{
TemplateFilePath = "./src/infra/resourceGroup.bicep"
TemplateParameterFilePath = "./src/infra/resourceGroup.prd.bicepparam"
}
- name: Deploy PROD resource group
uses: azure/powershell@v1
with:
inlineScript: |
$ParamsProd = @{
TemplateFilePath = "./src/infra/resourceGroup.bicep"
TemplateParameterFilePath = "./src/infra/resourceGroup.prd.bicepparam"
}

./src/scripts/Deploy-ToSubscription.ps1 @ParamsProd
azPSVersion: "11.4.0"
./src/scripts/Deploy-ToSubscription.ps1 @ParamsProd
azPSVersion: "11.4.0"
Loading