-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (36 loc) · 1.24 KB
/
azure-app-service-settings.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# https://github.com/marketplace/actions/azure-app-service-settings
name: Azure App Service Settings
on:
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
apply-azure-app-service-settings:
runs-on: ubuntu-latest
environment: Production
steps:
- name: Dump context
run: echo "${{ toJSON(github) }}"
- name: Set current datetime as env variable
env:
TZ: 'Asia/Tokyo'
run: |
CURRENT_DATETIME=$(date +'%Y-%m-%d_%H:%M:%S')
SETTINGS=$(echo "${{ vars.AZURE_WEBAPP_APP_SETTINGS }}" | sed "s/{0}/$CURRENT_DATETIME/")
echo 'SETTINGS="$SETTINGS"' >> $GITHUB_ENV
- name: Az 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: Azure App Service Settings
uses: Azure/appservice-settings@v1
with:
app-name: ${{ vars.AZURE_WEBAPP_NAME }}
slot-name: 'Production'
app-settings-json: '${{ env.SETTINGS }}'
general-settings-json: '${{ vars.AZURE_WEBAPP_GENERAL_SETTINGS }}'
- name: Az CLI Logout
run: az logout