Skip to content

Commit

Permalink
rename envs
Browse files Browse the repository at this point in the history
  • Loading branch information
dogfrogfog committed Nov 21, 2023
1 parent eb7465b commit 651f5b6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
10 changes: 6 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ SANITY_API_READ_TOKEN=
NEXT_PUBLIC_SANITY_PROJECT_ID=
NEXT_PUBLIC_SANITY_DATASET=

REPO_TYPE="github"
REPO_ID="684968839"
REPO_NAME="focusreactive/Demo-NextJS13-Sanity"
REPO_PROD_BRANCH="main"
REPO_WORKFLOW_ID="75419986"

REPO_TYPE=
TEAM_GITHUB_REPO_ID=
TEAM_GITHUB_REPO_PRODUCTION_BRANCH=
PROJECT_NAME=
PROJECT_NAME="mvp-next-sanity"

SANITY_ORGANIZATION_ID=
VERCEL_FR_TEAM_ID=
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/import-dataset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ jobs:
"project": "${{ inputs.vercel-project-id }}",
"target": "production",
"gitSource": {
"repoId": "${{ secrets.TEAM_GITHUB_REPO_ID }}",
"ref": "${{ secrets.TEAM_GITHUB_REPO_PRODUCTION_BRANCH }}",
"repoId": "${{ secrets.REPO_ID }}",
"ref": "${{ secrets.REPO_PROD_BRANCH }}",
"type": "${{ secrets.REPO_TYPE }}"
}
}'
4 changes: 2 additions & 2 deletions app/api/roll-out/deploy/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export async function POST() {
name: process.env.VERCEL_PROJECT_ID,
project: process.env.VERCEL_PROJECT_NAME,
gitSource: {
repoId: process.env.TEAM_GITHUB_REPO_ID,
ref: process.env.TEAM_GITHUB_REPO_PRODUCTION_BRANCH,
repoId: process.env.REPO_ID,
ref: process.env.REPO_PROD_BRANCH,
type: process.env.REPO_TYPE,
},
target: 'production',
Expand Down
12 changes: 6 additions & 6 deletions lib/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ export async function createVercelProject({
value: sanityDatasetName,
},
{
key: 'TEAM_GITHUB_REPO_ID',
value: process.env.TEAM_GITHUB_REPO_ID,
key: 'REPO_ID',
value: process.env.REPO_ID,
},
{
key: 'TEAM_GITHUB_REPO_PRODUCTION_BRANCH',
value: process.env.TEAM_GITHUB_REPO_PRODUCTION_BRANCH,
key: 'REPO_PROD_BRANCH',
value: process.env.REPO_PROD_BRANCH,
},
{
key: 'REPO_TYPE',
Expand Down Expand Up @@ -133,15 +133,15 @@ export async function triggerGithubWorkflow({
console.log('Triggering github workflow...⏳');

const response = await fetch(
`https://api.github.com/repos/focusreactive/Demo-NextJS13-Sanity/actions/workflows/75419986/dispatches`,
`https://api.github.com/repos/${process.env.REPO_NAME}/actions/workflows/${process.env.REPO_WORKFLOW_ID}/dispatches`,
{
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.GITHUB_PERSONAL_ACCESS_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
ref: process.env.TEAM_GITHUB_REPO_PRODUCTION_BRANCH,
ref: process.env.REPO_PROD_BRANCH,
inputs: {
email: email,
'sanity-project-id': sanityProjectId,
Expand Down

0 comments on commit 651f5b6

Please sign in to comment.