-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upload js assets to datadog in ci
- Loading branch information
1 parent
11293af
commit 5b0a663
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Upload JS and sourcemaps to DataDog | ||
on: | ||
workflow_dispatch: | ||
workflow_run: | ||
workflows: ["Deploy Energy Apps"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
dd-js-upload: | ||
env: | ||
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} | ||
DATADOG_SITE: datadoghq.eu | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Setup ruby" | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
|
||
- name: "Setup node" | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .nvmrc | ||
|
||
- name: "Install npm packages" | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: "Install datadog-ci upload tools" | ||
run: npm install -g @datadog/datadog-ci | ||
|
||
- name: "Precompile assets" | ||
run: bundle exec rails assets:precompile | ||
|
||
- name: "Upload js assets" | ||
run: | | ||
datadog-ci sourcemaps upload ./public/energy-apps-assets \ | ||
--service=energy-apps \ | ||
--release-version=${{ github.sha }} \ | ||
--minified-path-prefix=/energy-apps-assets/ |