-
Notifications
You must be signed in to change notification settings - Fork 48
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
041c86d
commit 88cccdc
Showing
2 changed files
with
66 additions
and
36 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,66 @@ | ||
name: CI/CD - Deploy App and Bicep | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
id-token: write | ||
pull-requests: write | ||
contents: read | ||
|
||
jobs: | ||
build_and_test: | ||
runs-on: ubuntu-latest | ||
name: Build, Test, Upload Artifact | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run dotnet test | ||
run: | | ||
dotnet test -c Release | ||
- name: Run dotnet publish | ||
run: | | ||
dotnet publish ./src/WorkshopDemo/WorkshopDemo.csproj -c Release -o ./publish | ||
- name: Update version file with GHA run number and git short SHA | ||
run: echo $(date +'%Y%m%d.%H%M').${{github.run_number}}-$(git rev-parse --short HEAD) > publish/version.txt | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dotnet-artifact | ||
path: publish/ | ||
# dev: | ||
# needs: build_and_test | ||
# uses: ./.github/workflows/step-deploy.yml | ||
# with: | ||
# env: dev | ||
# artifact_name: dotnet-artifact | ||
# resource_group_name: rg-workshop-dnazghbicep-<YOURUSERNAMEHERE>-dev | ||
# app_service_name: app-workshop-dnazghbicep-<YOURUSERNAMEHERE>-dev | ||
# app_service_slot_name: slot | ||
# # Note: use GH Environment Secrets if using a Pro/Enterprise version of GH | ||
# secrets: | ||
# azure_client_id: ${{ secrets.DEV_AZURE_CLIENT_ID }} | ||
# azure_subscription_id: ${{ secrets.DEV_AZURE_SUBSCRIPTION_ID }} | ||
# azure_tenant_id: ${{ secrets.DEV_AZURE_TENANT_ID }} | ||
|
||
# prod: | ||
# needs: dev | ||
# uses: ./.github/workflows/step-deploy.yml | ||
# with: | ||
# env: prod | ||
# artifact_name: dotnet-artifact | ||
# resource_group_name: rg-workshop-dnazghbicep-<YOURUSERNAMEHERE>-prod | ||
# app_service_name: app-workshop-dnazghbicep-<YOURUSERNAMEHERE>-prod | ||
# app_service_slot_name: slot | ||
# # Note: use GH Environment Secrets if using a Pro/Enterprise version of GH | ||
# secrets: | ||
# azure_client_id: ${{ secrets.PROD_AZURE_CLIENT_ID }} | ||
# azure_subscription_id: ${{ secrets.PROD_AZURE_SUBSCRIPTION_ID }} | ||
# azure_tenant_id: ${{ secrets.PROD_AZURE_TENANT_ID }} |
This file was deleted.
Oops, something went wrong.