From c280a95995d5193026b9f993df6c497fcf9fe7a2 Mon Sep 17 00:00:00 2001 From: aksm-ms <58936966+aksm-ms@users.noreply.github.com> Date: Tue, 30 Jun 2020 09:12:18 +0530 Subject: [PATCH] Documentation updates for publish profile container (#40) * updated action.yml * Update action.yml * Update action.yml * Update README.md * Update README.md * Update README.md * Update README.md --- README.md | 35 ++++++++++++++++++++++++++++++++++- action.yml | 2 +- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 929ab9813..79bc7d714 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The definition of this Github Action is in [action.yml](https://github.com/Azure ## Dependencies on other Github Actions * [Checkout](https://github.com/actions/checkout) Checkout your Git repository content into Github Actions agent. -* Authenticate using [Azure Web App Publish Profile](https://github.com/projectkudu/kudu/wiki/Deployment-credentials#site-credentials-aka-publish-profile-credentials) or using [Azure Login](https://github.com/Azure/login) +* Authenticate using [Azure Web App Publish Profile](https://github.com/projectkudu/kudu/wiki/Deployment-credentials#site-credentials-aka-publish-profile-credentials) or using [Azure Login](https://github.com/Azure/login). Action supports publish profile for [Azure Web Apps](https://azure.microsoft.com/en-us/services/app-service/web/) (both Windows and Linux) and [Azure Web Apps for Containers](https://azure.microsoft.com/en-us/services/app-service/containers/) (Linux only). Action does not support multi-container scenario with publish profile. * To build app code in a specific language based environment, use setup actions * [Setup DotNet](https://github.com/actions/setup-dotnet) Sets up a dotnet environment by optionally downloading and caching a version of dotnet by SDK version and adding to PATH . * [Setup Node](https://github.com/actions/setup-node) sets up a node environment by optionally downloading and caching a version of node - npm by version spec and add to PATH @@ -78,6 +78,39 @@ jobs: publish-profile: ${{ secrets.azureWebAppPublishProfile }} +``` +### Sample workflow to build and deploy a Node.js app to Containerized WebApp using publish profile + +```yaml + +on: [push] + +name: Linux_Container_Node_Workflow + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + # checkout the repo + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - uses: azure/docker-login@v1 + with: + login-server: contoso.azurecr.io + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - run: | + docker build . -t contoso.azurecr.io/nodejssampleapp:${{ github.sha }} + docker push contoso.azurecr.io/nodejssampleapp:${{ github.sha }} + + - uses: azure/webapps-deploy@v2 + with: + app-name: 'node-rnc' + publish-profile: ${{ secrets.azureWebAppPublishProfile }} + images: 'contoso.azurecr.io/nodejssampleapp:${{ github.sha }}' + ``` #### Configure deployment credentials: diff --git a/action.yml b/action.yml index d62a6d82c..826cf7801 100644 --- a/action.yml +++ b/action.yml @@ -6,7 +6,7 @@ inputs: description: 'Name of the Azure Web App' required: true publish-profile: - description: 'Applies to Web App only: Publish profile (*.publishsettings) file contents with Web Deploy secrets' + description: 'Applies to Web Apps(Windows and Linux) and Web App Containers(linux). Multi container scenario not supported. Publish profile (*.publishsettings) file contents with Web Deploy secrets' required: false slot-name: description: 'Enter an existing Slot other than the Production slot'