This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: (TEST) build and deploy - integrator-backend | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| workflow_dispatch: | |
| env: | |
| AZURE_WEBAPP_NAME: integrator-backend | |
| AZURE_WEBAPP_PACKAGE_PATH: "./backend" | |
| NODE_VERSION: "18.x" | |
| jobs: | |
| build-and-deploy: | |
| name: Build and Deploy | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@main | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: ${{env.NODE_VERSION}} | |
| - name: Cache node modules | |
| id: cached-nodemodules | |
| uses: actions/cache@v2 | |
| env: | |
| cache-name: cache-node-modules | |
| with: | |
| path: ./backend/node_modules | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-${{ env.cache-name }}- | |
| ${{ runner.os }}-build- | |
| ${{ runner.os }}- | |
| - name: install packages, build (if necessary), test (if exists) | |
| run: npm ci | |
| working-directory: ${{env.AZURE_WEBAPP_PACKAGE_PATH}} | |
| - name: Deploy to Azure | |
| 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}} | |