-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add Azure Bicep deployment workflow
- Loading branch information
1 parent
aa966e9
commit 4b91c70
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |