Skip to content

Commit

Permalink
modify workflow, add lint job, combine build and deploy for speeed
Browse files Browse the repository at this point in the history
  • Loading branch information
SjoenH committed May 6, 2024
1 parent 48ea1ee commit 575b8f4
Showing 1 changed file with 18 additions and 24 deletions.
42 changes: 18 additions & 24 deletions .github/workflows/main_app-kabinizer-client-dev.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -10,7 +7,7 @@ on:
workflow_dispatch:

jobs:
build:
lint:
runs-on: ubuntu-latest

steps:
Expand All @@ -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
Expand All @@ -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

0 comments on commit 575b8f4

Please sign in to comment.