new pr bicep demo
هذا الالتزام موجود في:
15
.github/workflows/lint.yml
مباع
Normal file
15
.github/workflows/lint.yml
مباع
Normal file
@@ -0,0 +1,15 @@
|
||||
name: lint
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint code
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Lint code
|
||||
run: |
|
||||
az bicep build --file bicep/main.bicep
|
31
.github/workflows/pr-closed.yml
مباع
Normal file
31
.github/workflows/pr-closed.yml
مباع
Normal file
@@ -0,0 +1,31 @@
|
||||
name: pr-closed
|
||||
concurrency: ${{ github.event.number }}
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
|
||||
env:
|
||||
resourceGroupName: pr_${{ github.event.number }}
|
||||
|
||||
jobs:
|
||||
remove:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: azure/login@v1
|
||||
name: Sign in to Azure
|
||||
with:
|
||||
client-id: ${{ secrets.AZURE_CLIENT_ID }}
|
||||
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
||||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
||||
- uses: Azure/cli@v1
|
||||
name: Delete resource group
|
||||
with:
|
||||
inlineScript: |
|
||||
az group delete \
|
||||
--name ${{ env.resourceGroupName }} \
|
||||
--yes
|
47
.github/workflows/pr-validation.yml
مباع
Normal file
47
.github/workflows/pr-validation.yml
مباع
Normal file
@@ -0,0 +1,47 @@
|
||||
name: pr-validation
|
||||
concurrency: ${{ github.event.number }}
|
||||
|
||||
on: pull_request
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
|
||||
env:
|
||||
resourceGroupName: pr_${{ github.event.number }}
|
||||
resourceGroupLocation: eastus
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
uses: ./.github/workflows/lint.yml
|
||||
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: azure/login@v1
|
||||
name: Sign in to Azure
|
||||
with:
|
||||
client-id: ${{ secrets.AZURE_CLIENT_ID }}
|
||||
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
||||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
||||
- uses: Azure/cli@v1
|
||||
name: Create resource group
|
||||
with:
|
||||
inlineScript: |
|
||||
az group create \
|
||||
--name ${{ env.resourceGroupName }} \
|
||||
--location ${{ env.resourceGroupLocation }}
|
||||
- uses: azure/arm-deploy@v1
|
||||
id: deploy
|
||||
name: Deploy Bicep file
|
||||
with:
|
||||
failOnStdErr: false
|
||||
deploymentName: ${{ github.run_number }}
|
||||
resourceGroupName: ${{ env.resourceGroupName }}
|
||||
template: ./bicep/main.bicep
|
||||
parameters: >
|
||||
environmentType=Test
|
||||
- name: Show website hostname
|
||||
run: |
|
||||
echo "Access the website at this address: https://${{ steps.deploy.outputs.appServiceAppHostName }}"
|
المرجع في مشكلة جديدة
حظر مستخدم