diff --git a/.github/workflows/gem.yml b/.github/workflows/gem.yml index ec14844fe..22957862d 100644 --- a/.github/workflows/gem.yml +++ b/.github/workflows/gem.yml @@ -32,21 +32,6 @@ jobs: node-version: ${{ matrix.node-version }} cache: npm cache-dependency-path: frontend/package-lock.json - # Build YAML format Swagger doc - - name: Build Swagger doc - run: bundle exec rake build:swagger - # Build ReDoc docs & buld the frontend assets - - name: Buld frontend - run: | - npm install - npm run docs - npm run build-only - working-directory: frontend - # Copy the frontend assets into lib - - name: Copy forntend assets - run: | - mkdir -p lib/mihari/web/public/ - cp -r frontend/dist/* lib/mihari/web/public - name: Configure Git run: | git config --global user.name "${GITHUB_ACTOR}" diff --git a/Rakefile b/Rakefile index 724a7f3c1..d42bd553c 100644 --- a/Rakefile +++ b/Rakefile @@ -50,17 +50,15 @@ namespace :build do end end -def ci? - ENV.fetch("CI", false) -end - -unless ci? - task :build do - sh "cd frontend && npm install && npm run build" - sh "rm -rf ./lib/mihari/web/public/" - sh "mkdir -p ./lib/mihari/web/public/" - sh "cp -r frontend/dist/* ./lib/mihari/web/public" - end +task :build do + # Build Swagger dos + Rake::Task["build:swagger"].invoke + # Build ReDocs docs & frontend assets + sh "cd frontend && npm install && npm run docs && npm run build-only" + # Copy built assets into ./lib/web/public/ + sh "rm -rf ./lib/mihari/web/public/" + sh "mkdir -p ./lib/mihari/web/public/" + sh "cp -r frontend/dist/* ./lib/mihari/web/public" end # require it later enables doing pre-build step (= build the frontend app)