-
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.
Apparently azure gov won't support cross-cloud cli logins with app registrations.
- Loading branch information
1 parent
5280788
commit 8b8445c
Showing
1 changed file
with
16 additions
and
16 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 |
---|---|---|
@@ -1,31 +1,31 @@ | ||
name: .NET Core - Release from Master | ||
# | ||
# Run when pushed to master (successfull PR with branch permissions turned on) | ||
# | ||
on: | ||
push: | ||
branches: master | ||
|
||
branches: master | ||
env: | ||
AZURE_WEBAPP_NAME: qrcode-api-app # set this to your application's name | ||
|
||
jobs: | ||
build-and-deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Login to Azure | ||
run: dotnet build --configuration Release | ||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 2.2.108 | ||
|
||
- name: Build with dotnet | ||
run: dotnet build --configuration Release | ||
|
||
- name: dotnet publish | ||
run: | | ||
echo "Logging into Azure..." | ||
az login --service-principal -u ${{ secrets.CLIENT_ID }} -p ${{ secrets.CLIENT_SECRET }} --tenant ${{ secrets.TENANT_ID }} | ||
- name: 'Perform an az cli appservice slotswap' | ||
run: | | ||
echo "Running a CLI Slot Swap..." | ||
az webapp deployment slot swap --name qrcode-api-app --resource-group rgDoNotDeleteDemos --slot test --target-slot Production | ||
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp | ||
|
||
- name: 'Run Azure webapp deploy action using publish profile credentials' | ||
uses: azure/webapps-deploy@v1 | ||
with: | ||
app-name: ${{env.AZURE_WEBAPP_NAME}} | ||
publish-profile: ${{ secrets.azureWebAppPublishProfile }} | ||
package: ${{env.DOTNET_ROOT}}/myapp |