Skip to content

Commit

Permalink
chore: set up sourcemap uploads to Datadog
Browse files Browse the repository at this point in the history
Untested, so there's only a modest chance that this actually works.

Also, it's probably excruciatingly slow.
  • Loading branch information
wincent committed Aug 14, 2024
1 parent df688b9 commit 9764ba1
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/sourcemaps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and Upload Source Maps

on:
push:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install dependencies
run: |
node vendor/bin/yarn install \
--frozen-lockfile \
--non-interactive \
--offline
- name: Build project
run: node build.js

- name: Upload source maps to Datadog
env:
DD_VERSION: ${{ github.sha }}
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
run: |
npx @datadog/datadog-ci sourcemaps upload ./dist \
--service masochist \
--minified-path-prefix /static/ \
--project-path /./ \
--release-version $DD_VERSION \
--repository-url=https://github.com/wincent/masochist

1 comment on commit 9764ba1

@wincent
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untested, so there's only a modest chance that this actually works.

As per the following commit, seems it actually did work.

Also, it's probably excruciatingly slow.

Wasn't even that slow; for example:

[build](https://github.com/wincent/masochist/actions/runs/10384758075/job/28752458822#logs)
succeeded 2 minutes ago in 55s

Please sign in to comment.