Skip to content

Instantly share code, notes, and snippets.

@italopinto
Created September 3, 2021 18:47
Show Gist options
  • Save italopinto/0808e4433f7c4c0ee18803d09f9767ff to your computer and use it in GitHub Desktop.
Save italopinto/0808e4433f7c4c0ee18803d09f9767ff to your computer and use it in GitHub Desktop.
Github action based on the examples from https://github.com/marketplace/actions/azure-webapp
name: Deploy Node.js to Azure Web App
on: push
env:
AZURE_WEBAPP_NAME: node-app # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: "src/" # set this to the path to your web app project, defaults to the repository root
NODE_VERSION: "14.17.3" # node latest LTS version
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# checkout the repo
- name: "Checkout Github Action"
uses: actions/checkout@master
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: "npm install"
run: |
npm install
- name: "Run Azure webapp deploy action using publish profile credentials"
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.azureWebAppPublishProfile }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment