happy-software / shuffle_youtube_playlist

Combine your Youtube playlists and shuffle them
https://syt.hebron.wtf
2 stars 0 forks source link

Upload source maps to Honeybadger #131

Open ras1 opened 2 weeks ago

ras1 commented 2 weeks ago

If you want to upload the source maps from the gh-pages branch, you would need to check out the gh-pages branch after deploying and then upload the source maps. Here’s an updated version of the workflow to achieve that: name: Deploy to GitHub Pages

on: push: branches:

jobs: build-and-deploy: runs-on: ubuntu-latest

steps:
  - name: Checkout repository
    uses: actions/checkout@v2

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

  - name: Install dependencies
    run: npm install

  - name: Build the project
    run: npm run build

  - name: Deploy to GitHub Pages
    run: |
      npm install -g gh-pages
      gh-pages -d build

  - name: Checkout gh-pages branch
    run: |
      git fetch origin gh-pages:gh-pages
      git checkout gh-pages

  - name: Upload Source Maps to Honeybadger
    env:
      HONEYBADGER_API_KEY: ${{ secrets.HONEYBADGER_API_KEY }}
      REVISION: ${{ github.sha }}
    run: |
      for file in static/js/*.map; do
        curl https://api.honeybadger.io/v1/source_maps \
          -F api_key=$HONEYBADGER_API_KEY \
          -F revision=$REVISION \
          -F minified_url=https://<YOUR_GITHUB_USERNAME>.github.io/<YOUR_REPO_NAME>/static/js/$(basename ${file%.map}) \
          -F source_map=@$file \
          -F minified_file=@${file%.map}
      done

This updated workflow checks out the gh-pages branch after deploying and then uploads the source maps from that branch. If you have any more questions or need further assistance, feel free to ask! :blush: