-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (41 loc) · 1.46 KB
/
master.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Deploy Node.js to Azure Web App, Master
on:
push:
branches:
- master
workflow_dispatch:
env:
AZURE_WEBAPP_NAME: pos-backend-staging # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: 'dist' # set this to the path to your web app project, defaults to the repository root
NODE_VERSION: '18.x' # set this to the node version to use
jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: yarn install and build
run: |
# Build and test the project, then
# deploy to Azure Web App.
yarn install
yarn build
- name: run database migrations
run: DATABASE_URL=${{ secrets.DATABASE_URL_STAGING }} yarn migrate-up
- name: copy web.config and node_modules to dist
run: |
cp web.config dist/web.config
cp package.json dist/package.json
cp yarn.lock dist/yarn.lock
cp .deployment dist/.deployment
cp deploy.sh dist/deploy.sh
- name: 'Deploy to Azure WebApp'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_STAGING }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}