исходники файлом.
Что я делаю?
1. В веб-приложении отсутствует файл по пути ./src/environments/environment.prod.ts. Скрипт npm run config корректно создает файл с содержимым в GitHub Actions CI;
2. Затем приложение зачем-то билдится в GitHub CI (я спросил себя, зачем, но внятного ответа после бутылки колы не получил);
3. Затем приложение сбилдилось и отправляется в Heroku, там он опять по новой зачем-то билдится (я спросил Heroku support "Зачем?", но получил что-то типа "Пiшов нaхуй якут недевственный"), и падает с отсутствующим файлом, который на предыдущих этапах создался! WTF?
Привожу ямлик:
name: Build and Deploy
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18.x'
- name: Install dependencies
run: npm install
- name: Populate config
run: npm run config
- name: Build the app
run: npm run build --prod
env:
NODE_ENV: production
API_BASE_URL: ${{ secrets.API_BASE_URL }}
deploy:
# deploy to Heroku
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: akhileshns/heroku-deploy@v3.12.14
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
heroku_email: ${{ secrets.HEROKU_EMAIL }}
appdir: "dist/ord-data-frontend"
Привожу лог: Run akhileshns/heroku-deploy@v3.12.14 Created and wrote to ~/.netrc Successfully logged into heroku › Warning: Our terms of service have changed: Added git remote heroku › https://dashboard.heroku.com/terms-of-service remote: Updated 56 paths from 2c815eb remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-22 stack remote: -----> Determining which buildpack to use for this app remote: -----> Node.js app detected remote: remote: -----> Creating runtime environment remote: remote: NPM_CONFIG_LOGLEVEL=error remote: NODE_VERBOSE=false remote: NODE_ENV=production remote: NODE_MODULES_CACHE=true remote: remote: -----> Installing binaries remote: engines.node (package.json): 18.x remote: engines.npm (package.json): unspecified (use default) remote: remote: Resolving node version 18.x... remote: Downloading and installing node 18.17.1... remote: Using default npm version: 9.6.7 remote: remote: -----> Installing dependencies remote: Installing node modules remote: remote: added 1023 packages, and audited 1024 packages in 12s remote: remote: 113 packages are looking for funding remote: run `npm fund` for details remote: remote: found 0 vulnerabilities remote: npm notice remote: npm notice New minor version of npm available! 9.6.7 -> 9.8.1 remote: npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.8.1> remote: npm notice Run `npm install -g npm@9.8.1` to update! remote: npm notice remote: remote: -----> Build remote: ! "ng build" detected as build script. We recommend you use `ng build --prod` or add `--prod` to your build flags. See https://devcenter.heroku.com/articles/nodejs-support#build-flags remote: https://devcenter.heroku.com/articles/nodejs-support remote: remote: Running build remote: remote: > ***@0.0.0 build remote: > ng build remote: remote: /tmp/build_e309b77a/node_modules/rxjs/dist/cjs/internal/util/reportUnhandledError.js:13 remote: throw err; remote: ^ remote: Error: MissingFileReplacementException [Error]: The /tmp/build_e309b77a/src/environments/environment.prod.ts path in file replacements does not exist. remote: at normalizeFileReplacements (/tmp/build_e309b77a/node_modules/@angular-devkit/build-angular/src/utils/normalize-file-replacements.js:50:19) remote: at normalizeBrowserSchema (/tmp/build_e309b77a/node_modules/@angular-devkit/build-angular/src/utils/normalize-builder-schema.js:23:87) remote: at generateBrowserWebpackConfigFromContext (/tmp/build_e309b77a/node_modules/@angular-devkit/build-angular/src/utils/webpack-browser-config.js:116:66) remote: at async generateI18nBrowserWebpackConfigFromContext (/tmp/build_e309b77a/node_modules/@angular-devkit/build-angular/src/utils/webpack-browser-config.js:67:20) remote: at async initialize (/tmp/build_e309b77a/node_modules/@angular-devkit/build-angular/src/builders/browser/index.js:67:62) remote: at async /tmp/build_e309b77a/node_modules/@angular-devkit/build-angular/src/builders/browser/index.js:98:32 remote: remote: Node.js v18.17.1 remote: remote: -----> Build failed
Обсуждают сегодня