Skip to content

Commit

Permalink
chore: Add Azure Bicep deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tsubakimoto committed Jul 1, 2024
1 parent aa966e9 commit 4b91c70
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/azure-bicep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# https://learn.microsoft.com/ja-jp/azure/azure-resource-manager/bicep/deploy-github-actions
name: Azure Bicep

on:
workflow_dispatch:

permissions:
id-token: write
contents: read

jobs:
deploy-bicep:
runs-on: ubuntu-latest
environment: Production
defaults:
run:
working-directory: 'bicep'
steps:
- uses: actions/checkout@v4

- name: Set up Azure CLI
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Create resource group
id: resourceGroup
run: |
RESOURCE_GROUP=rg-bicep-from-actions-$RANDOM
echo "group-name=$RESOURCE_GROUP" >> $GITHUB_OUTPUT
az group create --name $RESOURCE_GROUP --location japaneast
- name: Deploy Bicep
uses: azure/arm-deploy@v2
with:
scope: resource-group
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }}
resourceGroupName: ${{ steps.resourceGroup.outputs.group-name }}
template: ./main.bicep
parameters: 'storagePrefix=yuta storageSKU=Standard_LRS'
failOnStdErr: false

0 comments on commit 4b91c70

Please sign in to comment.