forked from microsoft/dotnet-podcasts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07eee22
commit 12a148a
Showing
513 changed files
with
22,965 additions
and
8 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,25 @@ | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/azds.yaml | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md |
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 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
schedule: | ||
- cron: '15 21 * * 0' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'csharp', 'javascript' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v1 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
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,113 @@ | ||
name: Podcast API CICD | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- 'src/Services/Podcasts/**' | ||
- 'deploy/Services/api.deployment.json' | ||
- '.github/workflows/podcast-api.yml' | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- 'src/Services/Podcasts/**' | ||
- '.github/workflows/podcast-api.yml' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
build-pr: | ||
if: ${{ github.event_name == 'pull_request'}} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build Podcast Updater | ||
run: docker build -f ./src/Services/Podcasts/Podcast.Updater.Worker/Dockerfile -t ${{ secrets.ACR_NAME }}.azurecr.io/podcastupdaterworker:${{ github.sha }} . | ||
|
||
- name: Build Podcast API | ||
run: docker build -f ./src/Services/Podcasts/Podcast.API/Dockerfile -t ${{ secrets.ACR_NAME }}.azurecr.io/podcastapi:${{ github.sha }} . | ||
|
||
- name: Build Podcast Ingestion | ||
run: docker build -f ./src/Services/Podcasts/Podcast.Ingestion.Worker/Dockerfile -t ${{ secrets.ACR_NAME }}.azurecr.io/podcastingestionworker:${{ github.sha }} . | ||
|
||
build-and-push: | ||
if: ${{ github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.merged == true) }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
enable-AzPSSession: true | ||
|
||
- name: Deploy ACR | ||
uses: azure/powershell@v1 | ||
with: | ||
azPSVersion: '3.1.0' | ||
inlineScript: | | ||
az deployment group create -n ghactionbgtasks${{ github.sha }} -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} --template-file deploy/Services/acr.deployment.json --parameters acrName=${{secrets.ACR_NAME}} | ||
- name: Login to ACR | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ secrets.ACR_NAME }}.azurecr.io | ||
username: ${{ fromJson(secrets.AZURE_CREDENTIALS).clientId }} | ||
password: ${{ fromJson(secrets.AZURE_CREDENTIALS).clientSecret }} | ||
|
||
- name: Build Podcast Updater | ||
run: | | ||
docker build -f ./src/Services/Podcasts/Podcast.Updater.Worker/Dockerfile -t ${{ secrets.ACR_NAME }}.azurecr.io/podcastupdaterworker:${{ github.sha }} . | ||
docker push ${{ secrets.ACR_NAME }}.azurecr.io/podcastupdaterworker:${{ github.sha }} | ||
- name: Build Podcast API | ||
run: | | ||
docker build -f ./src/Services/Podcasts/Podcast.API/Dockerfile -t ${{ secrets.ACR_NAME }}.azurecr.io/podcastapi:${{ github.sha }} . | ||
docker push ${{ secrets.ACR_NAME }}.azurecr.io/podcastapi:${{ github.sha }} | ||
- name: Build Podcast Ingestion | ||
run: | | ||
docker build -f ./src/Services/Podcasts/Podcast.Ingestion.Worker/Dockerfile -t ${{ secrets.ACR_NAME }}.azurecr.io/podcastingestionworker:${{ github.sha }} . | ||
docker push ${{ secrets.ACR_NAME }}.azurecr.io/podcastingestionworker:${{ github.sha }} | ||
deploy: | ||
needs: build-and-push | ||
environment: | ||
name: prod | ||
if: ${{ github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.merged == true) }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
enable-AzPSSession: true | ||
|
||
- name: Deploy Container Apps | ||
uses: azure/powershell@v1 | ||
with: | ||
azPSVersion: '3.1.0' | ||
failOnStandardError: true | ||
inlineScript: | | ||
$ACR_LOGIN_SERVER="${{secrets.ACR_NAME}}.azurecr.io" | ||
$ACR_PASSWORD=$(az acr credential show -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} -n ${{secrets.ACR_NAME}} -o tsv --query passwords[0].value) | ||
az deployment group create -n ghaction${{ github.sha }} ` | ||
--resource-group ${{secrets.AZURE_RESOURCE_GROUP_NAME}} ` | ||
--template-file deploy/Services/api.deployment.json ` | ||
--parameters acrPassword=$ACR_PASSWORD acrLogin=${{secrets.ACR_NAME}} acrLoginServer=$ACR_LOGIN_SERVER imageTag=${{ github.sha }} administratorLogin=${{secrets.PODCASTDB_USER_LOGIN}} administratorLoginPassword=${{secrets.PODCASTDB_USER_PASSWORD}} storageAccountName=${{ secrets.STORAGE_NAME }} serverName=${{secrets.PODCASTDB_SERVER_NAME}} kubernetesEnvName=${{secrets.KUBERNETES_ENV_NAME}} workspaceName=${{secrets.WORKSPACE_NAME}} | ||
if( $LASTEXITCODE -ne 0 ) { exit -1 } | ||
- name: Upload Images | ||
uses: azure/powershell@v1 | ||
with: | ||
azPSVersion: '3.1.0' | ||
inlineScript: | | ||
cd deploy/Images | ||
./Deploy-Images.ps1 -resourceGroup ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} -storageName ${{ secrets.STORAGE_NAME }} |
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,75 @@ | ||
name: Podcast Hub CICD | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- 'src/Services/ListenTogether/**' | ||
- 'deploy/Services/hub.deployment.json' | ||
- '.github/workflows/podcast-hub.yml' | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- 'src/Services/ListenTogether/**' | ||
- '.github/workflows/podcast-hub.yml' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '6.0.x' | ||
include-prerelease: true | ||
|
||
- name: Build | ||
run: dotnet build --configuration Release src/Services/ListenTogether/ListenTogether.Hub | ||
|
||
- name: Publish | ||
run: dotnet publish --configuration Release src/Services/ListenTogether/ListenTogether.Hub --output hub | ||
|
||
- uses: actions/upload-artifact@master | ||
with: | ||
name: drop | ||
path: hub | ||
|
||
deploy: | ||
needs: build | ||
environment: | ||
name: prod | ||
if: ${{ github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.merged == true) }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
enable-AzPSSession: true | ||
|
||
- name: Deploy ARM | ||
uses: azure/powershell@v1 | ||
with: | ||
azPSVersion: '3.1.0' | ||
inlineScript: | | ||
az extension add --source https://workerappscliextension.blob.core.windows.net/azure-cli-extension/containerapp-0.2.0-py2.py3-none-any.whl --yes | ||
$PODCAST_API_URL ="https://"+$(az containerapp show -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} -n podcastapica -o tsv --query configuration.ingress.fqdn)+"/" | ||
az deployment group create -n ghactionlistentogether${{ github.sha }} -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} --template-file deploy/Services/hub.deployment.json --parameters webAppName=${{secrets.HUB_WEBAPP_NAME}} servicePlanName=${{secrets.SERVICE_PLAN_NAME}} podcastApiUrl=$PODCAST_API_URL administratorLogin=${{secrets.PODCASTDB_USER_LOGIN}} administratorLoginPassword=${{secrets.PODCASTDB_USER_PASSWORD}} serverName=${{secrets.PODCASTDB_SERVER_NAME}} | ||
- uses: actions/download-artifact@master | ||
with: | ||
name: drop | ||
path: hub | ||
|
||
- name: Azure WebApp | ||
uses: Azure/webapps-deploy@v2 | ||
with: | ||
app-name: ${{ secrets.HUB_WEBAPP_NAME }} | ||
package: hub | ||
|
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,123 @@ | ||
name: Podcast Web CICD | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- "src/Web/**" | ||
- ".github/workflows/podcast-web.yml" | ||
- "deploy/Web/web.deployment.json" | ||
pull_request: | ||
branches: [main] | ||
paths: | ||
- "src/Web/**" | ||
- ".github/workflows/podcast-web.yml" | ||
- "deploy/Web/web.deployment.json" | ||
workflow_dispatch: | ||
|
||
env: | ||
API_RESOURCE_NAME: podcastapica | ||
|
||
jobs: | ||
build: | ||
environment: | ||
name: prod | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: "6.0.x" | ||
|
||
- name: Install wasm-tools | ||
run: dotnet workload install wasm-tools | ||
|
||
- uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
- name: Set backend env variables | ||
uses: azure/powershell@v1 | ||
with: | ||
azPSVersion: "latest" | ||
inlineScript: | | ||
az extension add --source https://workerappscliextension.blob.core.windows.net/azure-cli-extension/containerapp-0.2.0-py2.py3-none-any.whl --yes | ||
az provider register --namespace Microsoft.Web | ||
$apiUrl = "https://$(az containerapp show -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} -n ${{ env.API_RESOURCE_NAME }} -o tsv --query configuration.ingress.fqdn)" | ||
$listenTogetherHubUrl = "https://${{ secrets.HUB_WEBAPP_NAME }}.azurewebsites.net/listentogether" | ||
echo "PODCAST_API_URL=$apiUrl" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | ||
echo "LISTEN_TOGETHER_HUB_URL=$listenTogetherHubUrl" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | ||
- name: Set Blazor WASM app settings | ||
uses: microsoft/variable-substitution@v1 | ||
with: | ||
files: 'src/Web/Client/wwwroot/appsettings.json' | ||
env: | ||
PodcastApi.BaseAddress: ${{ env.PODCAST_API_URL }} | ||
ListenTogetherHub: ${{ env.LISTEN_TOGETHER_HUB_URL }} | ||
|
||
- name: Build | ||
run: dotnet build src/Web/Server --configuration Release | ||
|
||
- name: Publish | ||
run: dotnet publish --configuration Release src/Web/Server --output web | ||
|
||
- uses: actions/upload-artifact@master | ||
with: | ||
name: drop | ||
path: web | ||
|
||
outputs: | ||
PodcastApiUrl: ${{ env.PODCAST_API_URL }} | ||
ListenTogetherHubUrl: ${{ env.LISTEN_TOGETHER_HUB_URL }} | ||
|
||
deploy: | ||
needs: build | ||
environment: | ||
name: prod | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
- name: Deploy ARM | ||
uses: azure/powershell@v1 | ||
with: | ||
azPSVersion: "3.1.0" | ||
inlineScript: | | ||
az deployment group create -n ghaction -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} --template-file deploy/Web/web.deployment.json --parameters webAppName=${{secrets.WEBAPP_NAME}} servicePlanName=${{secrets.SERVICE_PLAN_NAME}} servicePlanSku=${{secrets.SERVICE_PLAN_SKU}} | ||
- name: Download web artifacts | ||
uses: actions/download-artifact@master | ||
with: | ||
name: drop | ||
path: web | ||
|
||
- name: Update App Service app settings variables | ||
uses: Azure/appservice-settings@v1 | ||
with: | ||
app-name: ${{ secrets.WEBAPP_NAME }} | ||
app-settings-json: | | ||
[ | ||
{ | ||
"name": "PodcastApi__BaseAddress", | ||
"value": "${{ needs.build.outputs.PodcastApiUrl }}" | ||
}, | ||
{ | ||
"name": "ListenTogetherHub", | ||
"value": "${{ needs.build.outputs.ListenTogetherHubUrl }}" | ||
} | ||
] | ||
- name: Azure WebApp | ||
uses: Azure/webapps-deploy@v2 | ||
with: | ||
app-name: ${{ secrets.WEBAPP_NAME }} | ||
package: web |
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 |
---|---|---|
|
@@ -348,3 +348,4 @@ MigrationBackup/ | |
|
||
# Ionide (cross platform F# VS Code tools) working folder | ||
.ionide/ | ||
*.DS_Store |
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,9 @@ | ||
# Microsoft Open Source Code of Conduct | ||
|
||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
|
||
Resources: | ||
|
||
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) | ||
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) | ||
- Contact [[email protected]](mailto:[email protected]) with questions or concerns |
Oops, something went wrong.