Skip to content

Project update to v2 #847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .deployment-trigger

This file was deleted.

3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
GITHUB_APP_ID=
GITHUB_APP_PRIVATE_KEY=
GITHUB_INSTALLATION_ID=
1 change: 0 additions & 1 deletion .env.sample

This file was deleted.

3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
24 changes: 0 additions & 24 deletions .github/inactive/test.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/stale.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/preview-community.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Vercel Preview Community Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.PREVIEW_VERCEL_PROJECT_ID }}
on:
push:
branches:
- production
jobs:
Deploy-Production:
runs-on:
labels: ubuntu-latest
steps:
- name: Checkout the Codebase
uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Deploy on Vercel
id: deploy
run: |
vercel deploy --prod --token=${{ secrets.VERCEL_ACCESS_TOKEN }}
90 changes: 90 additions & 0 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Vercel Preview Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches-ignore:
- main
- production
jobs:
Deploy-Preview:
runs-on:
labels: ubuntu-latest
environment: preview
outputs:
deploymentUrl: ${{ steps.deploy.outputs.deploymentUrl }}
steps:
- name: Checkout the Codebase
uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Deploy on Vercel
id: deploy
run: |
vercel deploy --token=${{ secrets.VERCEL_ACCESS_TOKEN }} > deploy.log
URL=$(cat deploy.log | grep -o 'https://[^ ]*.vercel.app' | head -n1)
echo "deploymentUrl=$URL" >> $GITHUB_OUTPUT
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Assign Custom Domain
if: ${{ steps.extract_branch.outputs.branch == 'remove-basepath-2' }}
run: |
vercel alias set --token=${{ secrets.VERCEL_ACCESS_TOKEN }} ${{ steps.deploy.outputs.deploymentUrl }} ab-test-next-jwt-io.vercel.app --scope=okta

Add-Comment:
runs-on:
labels: ubuntu-latest
needs: Deploy-Preview
permissions:
issues: write
pull-requests: write
steps:
- name: Comment URL to PR
uses: actions/github-script@v6
id: comment-deployment-url-script
env:
DEPLOYMENT_URL: ${{ needs.Deploy-Preview.outputs.deploymentUrl }}
with:
script: |
// Get pull requests that are open for current ref.
const pullRequests = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
head: `${context.repo.owner}:${context.ref.replace('refs/heads/', '')}`
})

// Set issue number for following calls from context (if on pull request event) or from above variable.
const issueNumber = context.issue.number || pullRequests.data[0].number

// Retrieve existing bot comments for the PR
const {data: comments} = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
})
const botComment = comments.find(comment => {
return comment.user.type === 'Bot' && comment.body.includes('Preview URL at')
})

const output = "Preview URL " + process.env.DEPLOYMENT_URL

// If we have a comment, update it, otherwise create a new one
if (botComment) {
github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: output
})
} else {
github.rest.issues.createComment({
issue_number: issueNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
}
22 changes: 22 additions & 0 deletions .github/workflows/production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Vercel Production Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches:
- main
- production
jobs:
Deploy-Production:
runs-on:
labels: ubuntu-latest
steps:
- name: Checkout the Codebase
uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Deploy on Vercel
id: deploy
run: |
vercel deploy --prod --token=${{ secrets.VERCEL_ACCESS_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Semgrep

on:
pull_request_target: {}
push:
branches: ["master", "main"]
jobs:
semgrep:
name: Scan
runs-on:
labels: ubuntu-22.04-2cpu-8ram-75ssd
container:
image: returntocorp/semgrep
if: (github.actor != 'dependabot[bot]' && github.actor != 'snyk-bot')
steps:
- uses: actions/checkout@v3
- run: semgrep ci
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
Loading