Skip to content

Commit 495eb1b

Browse files
authored
Create deploy.yml
1 parent a31076d commit 495eb1b

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This workflow will build and push a node.js application to an Azure Web App when a release is created.
2+
#
3+
# This workflow assumes you have already created the target Azure App Service web app.
4+
# For instructions see https://docs.microsoft.com/azure/app-service/app-service-plan-manage#create-an-app-service-plan
5+
#
6+
# To configure this workflow:
7+
#
8+
# 1. Set up a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE with the value of your Azure publish profile.
9+
# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret
10+
#
11+
# 2. Change the values for the AZURE_WEBAPP_NAME, AZURE_WEBAPP_PACKAGE_PATH and NODE_VERSION environment variables (below).
12+
#
13+
# For more information on GitHub Actions for Azure, refer to https://github.com/Azure/Actions
14+
# For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples
15+
on:
16+
release:
17+
types: [created]
18+
19+
env:
20+
AZURE_WEBAPP_NAME: deserializerV2 # set this to your application's name
21+
AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
22+
NODE_VERSION: '12.x' # set this to the node version to use
23+
24+
jobs:
25+
build-and-deploy:
26+
name: Build and Deploy
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v2
30+
- name: Use Node.js ${{ env.NODE_VERSION }}
31+
uses: actions/setup-node@v1
32+
with:
33+
node-version: ${{ env.NODE_VERSION }}
34+
- name: npm install, build, and test
35+
run: |
36+
# Build and test the project, then
37+
# deploy to Azure Web App.
38+
npm install
39+
npm run build --if-present
40+
npm run test --if-present
41+
- name: 'Deploy to Azure WebApp'
42+
uses: azure/webapps-deploy@v2
43+
with:
44+
app-name: ${{ env.AZURE_WEBAPP_NAME }}
45+
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
46+
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

0 commit comments

Comments
 (0)