Skip to content

Commit

Permalink
add github action to build and deploy the dev CD/service
Browse files Browse the repository at this point in the history
NOTE: For testing, this is set to run on pushes to the elr/gh-action-dev-deploy branch.  It won’t run on initial push, but will run on following pushes.

TODO: Update trigger to deploy on merge to master branch.
  • Loading branch information
elrayle committed Jan 11, 2024
1 parent 4ae722e commit b46d41b
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build_and_deploy_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: JavaScript CI

on:
push:
branches:
- elr/gh-action-dev-deploy

env:
AZURE_WEBAPP_NAME: clearlydefined-api-dev
# AZURE_WEBAPP_PACKAGE_PATH: 'my-app-path' # TODO: confirm that root is the webapp root (default is root)
NODE_VERSION: '18' # TODO: does this need to have a minor version?

jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: npm install, build, and test
run: |
# Build and test the project, then
# deploy to Azure Web App.
npm install
npm run build --if-present
npm run test --if-present
working-directory: my-app-path
- name: 'Deploy to Azure WebApp'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
# package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} # TODO: uncomment if determined that root is not the webapp root

0 comments on commit b46d41b

Please sign in to comment.