Skip to content

deps(deps): bump media-typer from 1.1.0 to 1.1.1 #831

deps(deps): bump media-typer from 1.1.0 to 1.1.1

deps(deps): bump media-typer from 1.1.0 to 1.1.1 #831

Workflow file for this run

name: PR Preview
on:
pull_request:
types: [opened, synchronize, reopened]
branches: [main]
jobs:
deploy-preview:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
pull-requests: write
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-node@v7
with:
node-version: 24
- run: npm ci
- name: Build for PR preview
env:
VITE_BASE_PATH: /generated-game-experiment/pr-${{ github.event.number }}/
run: npm run build
- name: Deploy to GitHub Pages (PR Preview)
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
destination_dir: pr-${{ github.event.number }}
- name: Comment PR with preview URL
uses: actions/github-script@v9
with:
script: |
const prNumber = context.payload.number;
const previewUrl = `https://commjoen.github.io/generated-game-experiment/pr-${prNumber}/`;
// Check if we already commented with preview URL
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
});
const existingComment = comments.data.find(comment =>
comment.body.includes('🚀 Preview deployed') && comment.user.login === 'github-actions[bot]'
);
const commentBody = `🚀 **Preview deployed!**
Your changes are now available at: ${previewUrl}
*This preview will be automatically cleaned up when the PR is closed or merged.*`;
if (existingComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existingComment.id,
body: commentBody,
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: commentBody,
});
}