GitHub Action
Webpack Stat Reporter (packtracker.io)
Automated stat reporting for packtracker.io
Strategies to report your build stats via the following platforms
Note: If you started using CircleCI prior to 2.1, you must enable pipelines within your project configuration to be able to use the orbs configuration.
The first step in adding our orb to your configuration is to declare it in your CircleCI configuration file.
version: 2.1
orbs:
packtracker: packtracker/[email protected]
In order for us to know what project you are reporting stats for, you must send along your packtracker project token. To do this with the CircleCI Orb, you must create a new project environment variable in your CircleCI settings called PT_PROJECT_TOKEN
. You can find your packtracker project token in your project's settings.
Now that you've declared our orb for use and added your project token, you have access to our
report
job. You can put this job anywhere inside your existing CircleCI workflows, or
create a new workflow.
By default, this base configuration should just work most of the time. If you have a non-standard setup, you can tweak the job with the following 2 optional parameters.
version: 2.1
orbs:
packtracker: packtracker/report@dev:2.2.0
workflows:
packtracker:
jobs:
- packtracker/report
We try and assume your webpack configuration is located in the root of your repository as webpack.config.js
If it is not, you can let us know where it is like so.
workflows:
packtracker:
jobs:
- packtracker/report:
webpack_config: "./config/webpack/production.js"
For example, this is where the Ruby on Rails webpack configuration is located.
Sometimes you are trying to track a project within a greater repository, maybe the package.json does not live at the repository root, but in an internal directory. This is common for monorepo configurations like lerna.
workflows:
packtracker:
jobs:
- packtracker/report:
project_root: "./packages/internal_package"
PT_PROJECT_TOKEN
- your packtracker.io project token.
WEBPACK_CONFIG_PATH
- the relative path to your webpack configuration (if you have one)PT_PROJECT_ROOT
- the relative path to the directory of your project (containing your package.json file)
A sample workflow file might look something like this
workflow "packtracker.io" {
on = "push"
resolves = ["Report to packtracker.io"]
}
action "Report to packtracker.io" {
uses = "packtracker/[email protected]"
secrets = ["PT_PROJECT_TOKEN"]
env = {
"WEBPACK_CONFIG_PATH" = "./config/webpack/production.js"
"PT_PROJECT_ROOT" = "./path/to/subdirectory"
}
}