Upload JS and sourcemaps to DataDog #216
This file contains hidden or 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
| name: Upload JS and sourcemaps to DataDog | |
| on: | |
| workflow_dispatch: | |
| workflow_run: | |
| workflows: ["Deploy Energy Apps"] | |
| types: | |
| - completed | |
| jobs: | |
| dd-js-upload: | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| env: | |
| DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} | |
| DATADOG_SITE: datadoghq.eu | |
| IMAGE_TAG: ${{ github.sha }} | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v6 | |
| - name: "Setup ruby" | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| bundler-cache: true | |
| - name: "Setup node" | |
| uses: actions/setup-node@v6 | |
| 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=${{ env.IMAGE_TAG }} \ | |
| --minified-path-prefix=/energy-apps-assets/ |