Skip to content

.github/workflows/release.yml #42

.github/workflows/release.yml

.github/workflows/release.yml #42

Workflow file for this run

on:
release:
types: [created]
env:
AZURE_WEBAPP_NAME: pos-backend-production # 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_PRODUCTION }} 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_PRODUCTION }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}