0% found this document useful (0 votes)
21 views2 pages

Multi-Stage Azure Deployment Workflow

This workflow defines a reusable deployment job that can deploy a node application to either a Development or Production Azure Web App based on the target-env input. It downloads the built artifact, unzips it, and uses the Azure Web Apps Deploy action to deploy the package to the appropriate Azure Web App service defined by secrets, conditionally deploying to dev or prod based on the target environment.

Uploaded by

Sameer Wadkar32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

Multi-Stage Azure Deployment Workflow

This workflow defines a reusable deployment job that can deploy a node application to either a Development or Production Azure Web App based on the target-env input. It downloads the built artifact, unzips it, and uses the Azure Web Apps Deploy action to deploy the package to the appropriate Azure Web App service defined by secrets, conditionally deploying to dev or prod based on the target environment.

Uploaded by

Sameer Wadkar32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

name: Reusable deployment workflow

on:
workflow_call:
inputs:
target-env:
required: true
type: string
secrets:
AZURE_WEBAPP_SERVICE_NAME:
required: true
AZURE_WEBAPP_PUBLISH_PROFILE:
required: true
AZURE_WEBAPP_SERVICE_NAME_PROD:
required: true
AZURE_WEBAPP_PUBLISH_PROFILE_PROD:
required: true

jobs:
deploy:
name: Deploy to ${ { [Link]-env } }
permissions:
contents: none
runs-on: ubuntu-latest
environment:
name: ${ { [Link]-env } }
# url: $

steps:
- run: echo "🎉 target evn ${ { [Link]-env} }"
- run: echo "🎉 target evn [Link]-env"
- run: echo "💡 get azure webapp name from secrets $
{ { secrets.AZURE_WEBAPP_SERVICE_NAME } }"
- run: echo "🍏 is Dev ${ { [Link]-env } } == 'Development'"
- run: echo "🐧 is Prod ${ { [Link]-env } } == 'Production'"

- name: Download artifact from build job


uses: actions/download-artifact@v3
with:
name: node-app

- name: unzip artifact for deployment


run: unzip [Link]

- name: "Deploy to Azure Dev WebApp"


if: [Link]-env == 'Development'
id: deploy-to-webapp-dev
uses: azure/webapps-deploy@v2
with:
app-name: ${ { secrets.AZURE_WEBAPP_SERVICE_NAME } }
slot-name: "production"
publish-profile: ${ { secrets.AZURE_WEBAPP_PUBLISH_PROFILE } }
package: '.'

- name: "Deploy to Azure Prod WebApp"


if: [Link]-env == 'Production'
id: deploy-to-webapp-prod
uses: azure/webapps-deploy@v2
with:
app-name: ${ { secrets.AZURE_WEBAPP_SERVICE_NAME_PROD } }
slot-name: "production"
publish-profile: ${ { secrets.AZURE_WEBAPP_PUBLISH_PROFILE_PROD } }
package: '.'

You might also like