Deploy Podcast App Example #18
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
name: Deploy Podcast App Example | |
on: | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Azure CLI Login | |
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-json | |
uses: jsdaniell/create-json@v1.2.3 | |
with: | |
name: parameters.json | |
json: ${{ secrets.PARAMETERS_PODCAST_JSON }} | |
- name: Extract values from JSON variable | |
id: extract_json | |
run: | | |
echo "BASE_PREFIX=$(jq -r '.parameters.basePrefix.value' parameters.json)" >> $GITHUB_ENV | |
echo "LOCATION=$(jq -r '.parameters.location.value' parameters.json)" >> $GITHUB_ENV | |
- name: Azure CLI script file | |
uses: azure/cli@v2 | |
with: | |
azcliversion: 2.63.0 | |
inlineScript: | | |
DEPLOYMENT_NAME=${BASE_PREFIX}-deployment-$(date +%s) | |
az deployment sub create --name $DEPLOYMENT_NAME --location ${LOCATION} --template-file deploy/main.bicep --parameters parameters.json --parameters gitHubPat=${{ secrets.PAT_GITHUB }} |