Skip to content

Commit

Permalink
feat: upload js assets to datadog in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsauntson committed Feb 5, 2025
1 parent 11293af commit 5b0a663
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/upload-js-to-datadog.yml
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/

0 comments on commit 5b0a663

Please sign in to comment.