From 575b8f450ae8beeda7c67cd3dc586979cfff217c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henry=20Sj=C3=B8en?= Date: Mon, 6 May 2024 21:49:18 +0200 Subject: [PATCH] modify workflow, add lint job, combine build and deploy for speeed --- .../main_app-kabinizer-client-dev.yml | 42 ++++++++----------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main_app-kabinizer-client-dev.yml b/.github/workflows/main_app-kabinizer-client-dev.yml index da60fcf..7dbff70 100644 --- a/.github/workflows/main_app-kabinizer-client-dev.yml +++ b/.github/workflows/main_app-kabinizer-client-dev.yml @@ -1,7 +1,4 @@ -# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy -# More GitHub Actions for Azure: https://github.com/Azure/actions - -name: Frontend - Build and Deploy +name: Frontend - Lint, Build and Deploy on: push: @@ -10,7 +7,7 @@ on: workflow_dispatch: jobs: - build: + lint: runs-on: ubuntu-latest steps: @@ -21,31 +18,28 @@ jobs: with: node-version: 'lts/*' - - name: npm install, build + - name: Run ESLint run: | cd kabinizer-front-end - npm install - npm run build - rm -rf node_modules - - - name: Upload artifact for deployment job - uses: actions/upload-artifact@v4 - with: - name: node-app - path: ./kabinizer-front-end/dist + npx eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 - deploy: + build_and_deploy: runs-on: ubuntu-latest - needs: build - environment: - name: "Production" - url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + needs: lint steps: - - name: Download artifact from build job - uses: actions/download-artifact@v4 + - uses: actions/checkout@v4 + + - name: Set up Node.js version + uses: actions/setup-node@v4 with: - name: node-app + node-version: 'lts/*' + + - name: npm install, build + run: | + cd kabinizer-front-end + npm ci + npm run build - name: "Deploy to Azure Web App" uses: azure/webapps-deploy@v2 @@ -54,4 +48,4 @@ jobs: app-name: "app-kabinizer-client-dev" slot-name: "Production" publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_C4AAEA8978394A6FB11867CD9D72BE91 }} - package: . + package: ./kabinizer-front-end/dist