-
Notifications
You must be signed in to change notification settings - Fork 234
Fix publishprofile workflow #567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Akshay Kumar (kumaraksh1)
wants to merge
8
commits into
master
from
users/kumaraksh/fix-publishprofile-workflow
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
53cce47
Add a file to keep the version
kumaraksh1 632e66b
Merge branch 'master' of https://github.com/Azure/webapps-deploy
kumaraksh1 cb657e2
Merge branch 'master' of https://github.com/Azure/webapps-deploy
kumaraksh1 931f975
Merge branch 'master' of https://github.com/Azure/webapps-deploy
kumaraksh1 df41e55
Merge branch 'master' of https://github.com/Azure/webapps-deploy
kumaraksh1 8c32c32
Merge branch 'master' of https://github.com/Azure/webapps-deploy
kumaraksh1 a674db3
Harden Windows container publish profile workflow
kumaraksh1 013db91
Adding a comment
kumaraksh1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
85 changes: 6 additions & 79 deletions
85
.github/workflows/pr_check_windows_container_pubprofile.yml
This file contains hidden or 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,103 +1,30 @@ | ||
| # A workflow to validate PRs for the Windows Container Publish Profile action. This workflow is triggered on pull requests to the master branch and release branches. It checks out the code from the PR branch, installs dependencies, and builds the latest changes in the action. | ||
| name: pr_check_windows_container_publishprofile | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - releases/* | ||
| paths-ignore: | ||
| - '**.md' | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| - 'releases/*' | ||
|
|
||
| permissions: | ||
| id-token: write | ||
|
|
||
| env: | ||
| AZURE_WEBAPP_NAME: wincontainerswebapp # set this to your application's name | ||
| CONTAINER_REGISTRY: webdeployprtestscontainerregistry.azurecr.io # set secret with Container Registry URL, example : xyz.azurecr.io | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build-and-deploy: | ||
| environment: automation test | ||
| name: Validate PR | ||
| validate-pr: | ||
| name: Validate PR build | ||
| runs-on: windows-latest | ||
| steps: | ||
| # checkout the repo | ||
| - name: 'Checkout Github Action' | ||
| uses: actions/checkout@master | ||
| with: | ||
| repository: GH-ACE/python_container_App | ||
| ref: main | ||
| path: 'python_container_App' | ||
|
|
||
| - name: Azure authentication | ||
| uses: azure/login@v2 | ||
| with: | ||
| client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
| tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
|
||
| - name: Logout from Azure Container Registry | ||
| run: | | ||
| docker logout env.CONTAINER_REGISTRY | ||
|
|
||
| - name: Login to Azure Container Registry | ||
| uses: azure/docker-login@v1 | ||
| with: | ||
| login-server: ${{ env.CONTAINER_REGISTRY }} | ||
| username: ${{ secrets.WEBDEPLOY_TEST_ACR_USERNAME }} | ||
| password: ${{ secrets.WEBDEPLOY_TEST_ACR_PASSWORD }} | ||
|
|
||
| - name: Pull and tag an image and push it to ACR | ||
| run: | | ||
| pwd | ||
| cd python_container_App | ||
| docker pull mcr.microsoft.com/azure-app-service/windows/canary:5.0-nanoserver | ||
| docker tag mcr.microsoft.com/azure-app-service/windows/canary:5.0-nanoserver ${{ env.CONTAINER_REGISTRY }}/containerwebapp/canaryreplica:latest | ||
| docker push ${{ env.CONTAINER_REGISTRY }}/containerwebapp/canaryreplica:latest | ||
|
|
||
| - name: Set Web App ACR authentication | ||
| uses: Azure/appservice-settings@v1 | ||
| with: | ||
| app-name: ${{ env.AZURE_WEBAPP_NAME }} | ||
| app-settings-json: | | ||
| [ | ||
| { | ||
| "name": "DOCKER_REGISTRY_SERVER_PASSWORD", | ||
| "value": "${{ secrets.WEBDEPLOY_TEST_ACR_PASSWORD }}", | ||
| "slotSetting": false | ||
| }, | ||
| { | ||
| "name": "DOCKER_REGISTRY_SERVER_URL", | ||
| "value": "https://${{ env.CONTAINER_REGISTRY }}", | ||
| "slotSetting": false | ||
| }, | ||
| { | ||
| "name": "DOCKER_REGISTRY_SERVER_USERNAME", | ||
| "value": "${{ secrets.WEBDEPLOY_TEST_ACR_USERNAME }}", | ||
| "slotSetting": false | ||
| } | ||
| ] | ||
|
|
||
| - name: Checkout from PR branch | ||
| uses: actions/checkout@v2 | ||
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | ||
| with: | ||
| repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
| path: 'webapps-deploy' | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| persist-credentials: false | ||
|
|
||
| - name: Installing dependencies and building latest changes in action | ||
| run: | | ||
| cd webapps-deploy | ||
| npm ci | ||
| npm run package | ||
|
|
||
| - name: 'Deploy to Azure WebApp' | ||
| uses: ./webapps-deploy/ | ||
| with: | ||
| app-name: ${{ env.AZURE_WEBAPP_NAME }} # Replace with your app name | ||
| publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} | ||
| images: ${{ env.CONTAINER_REGISTRY }}/containerwebapp/canaryreplica:latest | ||
This file contains hidden or 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,99 @@ | ||
| name: windows_container_publishprofile_deploy | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - releases/* | ||
| paths-ignore: | ||
| - '**.md' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| AZURE_WEBAPP_NAME: wincontainerswebapp # set this to your application's name | ||
| CONTAINER_REGISTRY: webdeployprtestscontainerregistry.azurecr.io # set secret with Container Registry URL, example : xyz.azurecr.io | ||
|
|
||
| jobs: | ||
| build-and-deploy: | ||
| environment: automation test | ||
| name: Deploy trusted push | ||
| runs-on: windows-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - name: 'Checkout Github Action' | ||
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | ||
| with: | ||
| repository: GH-ACE/python_container_App | ||
| ref: main | ||
| path: 'python_container_App' | ||
| persist-credentials: false | ||
|
|
||
| - name: Azure authentication | ||
| uses: azure/login@7184910d9eb2b1c5e48f7073824a90609bb9b6d6 # v2.3.1 | ||
| with: | ||
| client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
| tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
|
||
| - name: Logout from Azure Container Registry | ||
| run: docker logout ${{ env.CONTAINER_REGISTRY }} | ||
|
|
||
| - name: Login to Azure Container Registry | ||
| uses: azure/docker-login@83efeb77770c98b620c73055fbb59b2847e17dc0 # v1 | ||
| with: | ||
| login-server: ${{ env.CONTAINER_REGISTRY }} | ||
| username: ${{ secrets.WEBDEPLOY_TEST_ACR_USERNAME }} | ||
| password: ${{ secrets.WEBDEPLOY_TEST_ACR_PASSWORD }} | ||
|
|
||
| - name: Pull and tag an image and push it to ACR | ||
| run: | | ||
| cd python_container_App | ||
| docker pull mcr.microsoft.com/azure-app-service/windows/canary:5.0-nanoserver | ||
| docker tag mcr.microsoft.com/azure-app-service/windows/canary:5.0-nanoserver ${{ env.CONTAINER_REGISTRY }}/containerwebapp/canaryreplica:latest | ||
| docker push ${{ env.CONTAINER_REGISTRY }}/containerwebapp/canaryreplica:latest | ||
|
|
||
| - name: Set Web App ACR authentication | ||
| uses: Azure/appservice-settings@1808c4fbba4b8723107948a295d396a5c0e33dcd # v1 | ||
| with: | ||
| app-name: ${{ env.AZURE_WEBAPP_NAME }} | ||
| app-settings-json: | | ||
| [ | ||
| { | ||
| "name": "DOCKER_REGISTRY_SERVER_PASSWORD", | ||
| "value": "${{ secrets.WEBDEPLOY_TEST_ACR_PASSWORD }}", | ||
| "slotSetting": false | ||
| }, | ||
| { | ||
| "name": "DOCKER_REGISTRY_SERVER_URL", | ||
| "value": "https://${{ env.CONTAINER_REGISTRY }}", | ||
| "slotSetting": false | ||
| }, | ||
| { | ||
| "name": "DOCKER_REGISTRY_SERVER_USERNAME", | ||
| "value": "${{ secrets.WEBDEPLOY_TEST_ACR_USERNAME }}", | ||
| "slotSetting": false | ||
| } | ||
| ] | ||
|
|
||
| - name: Checkout trusted action commit | ||
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | ||
| with: | ||
| path: 'webapps-deploy' | ||
| persist-credentials: false | ||
|
|
||
| - name: Installing dependencies and building latest changes in action | ||
| run: | | ||
| cd webapps-deploy | ||
| npm ci | ||
| npm run package | ||
|
|
||
| - name: 'Deploy to Azure WebApp' | ||
| uses: ./webapps-deploy/ | ||
| with: | ||
| app-name: ${{ env.AZURE_WEBAPP_NAME }} # Replace with your app name | ||
| publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} | ||
| images: ${{ env.CONTAINER_REGISTRY }}/containerwebapp/canaryreplica:latest |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.