chore(deps): bump next from 15.1.5 to 15.1.6 #147
Workflow file for this run
This file contains 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: Deploy PR | |
on: | |
pull_request: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
id-token: write | |
contents: read | |
pull-requests: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.actor != 'dependabot[bot]' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_ARN_DEV }} | |
aws-region: eu-west-2 | |
- name: Setup AWS Profile | |
run: | | |
aws configure set region eu-west-2 --profile tvseries-dev | |
aws configure set aws_access_key_id ${{ env.AWS_ACCESS_KEY_ID }} --profile tvseries-dev | |
aws configure set aws_secret_access_key ${{ env.AWS_SECRET_ACCESS_KEY }} --profile tvseries-dev | |
aws configure set aws_session_token ${{ env.AWS_SESSION_TOKEN }} --profile tvseries-dev | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
run_install: false | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.node-version' | |
cache: 'pnpm' | |
- name: Setup cache for Next.js | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/.next/cache | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('./pnpm-lock.yaml') }}-${{ hashFiles('src/**/*.{js,jsx,ts,tsx}') }} | |
restore-keys: | | |
${{ runner.os }}-nextjs-${{ hashFiles('./pnpm-lock.yaml') }}- | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Deploy PR | |
env: | |
MDBLIST_API_KEY: ${{ secrets.MDBLIST_API_KEY }} | |
AWS_HOSTED_ZONE_ID_DEV: ${{ secrets.AWS_HOSTED_ZONE_ID_DEV }} | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
TMDB_API_ACCESS_TOKEN: ${{ secrets.TMDB_API_ACCESS_TOKEN }} | |
TMDB_API_KEY: ${{ secrets.TMDB_API_KEY }} | |
run: pnpm sst deploy --stage pr-${{ github.event.pull_request.number }} | |
- name: Update PR with Preview URL | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const previewUrl = `https://pr-${context.issue.number}.dev.tvseri.es`; | |
const commentBody = `## 🚀 Your preview environment is ready! | |
${previewUrl} | |
> Auto-updates with new commits. Removed when PR is closed.`; | |
const { data: comments } = await github.rest.issues.listComments({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
}); | |
const existingComment = comments.find(comment => | |
comment.user.login === 'github-actions[bot]' && | |
comment.body.includes('preview environment') | |
); | |
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: context.issue.number, | |
body: commentBody, | |
}); | |
} |