-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from IntelliTect-Samples/9-test-environment
Configure test environment
- Loading branch information
Showing
5 changed files
with
93 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,46 @@ | ||
name: JokeUI396 CI/CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- 9-test-environment | ||
workflow_dispatch: | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
|
||
jobs: | ||
build_and_deploy_job: | ||
runs-on: ubuntu-latest | ||
name: Build and Deploy Job | ||
environment: dev | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: 'Login to Azure' | ||
uses: azure/login@v1 | ||
with: | ||
client-id: ${{ secrets.AZURE_CLIENT_ID_CREATED_SP }} | ||
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
- name: Get app key | ||
id: appkey | ||
run: | | ||
key=$(az staticwebapp secrets list --name JokeUi396-dev --query "properties.apiKey" -o tsv) | ||
echo "key=$key" >> "$GITHUB_OUTPUT" | ||
- name: Build And Deploy | ||
id: builddeploy | ||
uses: Azure/static-web-apps-deploy@v1 | ||
with: | ||
azure_static_web_apps_api_token: ${{ steps.appkey.outputs.key }} | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) | ||
action: "upload" | ||
###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### | ||
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig | ||
app_location: "/" # App source code path | ||
api_location: ".output/server" # Api source code path - optional | ||
output_location: ".output/public" # Built app content directory - optional | ||
###### End of Repository/Build Configurations ###### | ||
|
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
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,38 @@ | ||
param location string = resourceGroup().location | ||
param JokeSiteName string = 'JokeUi396-dev' | ||
|
||
resource JokeUi396_site_resource 'Microsoft.Web/staticSites@2022-09-01' = { | ||
name: JokeSiteName | ||
location: location | ||
sku: { | ||
name: 'Free' | ||
tier: 'Free' | ||
} | ||
properties: { | ||
repositoryUrl: 'https://github.com/IntelliTect-Samples/JokeUi396' | ||
branch: 'main' | ||
stagingEnvironmentPolicy: 'Enabled' | ||
allowConfigFileUpdates: true | ||
provider: 'GitHub' | ||
enterpriseGradeCdnStatus: 'Disabled' | ||
} | ||
} | ||
|
||
// resource Joke_APIM_resource 'Microsoft.Web/staticSites/linkedBackends@2022-09-01' = { | ||
// name: 'jokeapim' | ||
// kind: 'API Management' | ||
// parent: JokeUi396_site_resource | ||
// properties: { | ||
// backendResourceId: subscriptionResourceId('Microsoft.ApiManagement/service', 'jokeapim') | ||
// region: location | ||
// } | ||
// } | ||
|
||
// '/subscriptions/a5045d8f-5a9a-4d29-aaee-1f829d64bee0/resourceGroups/jokefunction396/providers/Microsoft.ApiManagement/service/jokeapim' | ||
|
||
// resource staticSites_JokeUi396_name_intellitectsamples_com 'Microsoft.Web/staticSites/customDomains@2022-09-01' = { | ||
// parent:_JokeUi396_site_resource | ||
// name: 'intellitectsamples.com' | ||
// location: 'West US 2' | ||
// properties: {} | ||
// } |
File renamed without changes.
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,8 @@ | ||
# https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/~/Credentials/appId/875a99e3-f3f2-4db4-8c51-f6ff26ee5b32/isMSAApp~/false | ||
|
||
|
||
az deployment group create --resource-group Joke-dev --template-file .\build\env\main.bicep | ||
|
||
$key = az staticwebapp secrets list --name JokeUi396-dev --query "properties.apiKey" -o tsv | ||
|
||
az staticwebapp show --name JokeUi396-dev --query "repositoryUrl" |