Skip to content

Commit

Permalink
Vercel deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
petrvecera committed Dec 16, 2024
1 parent 2a689e5 commit 635421a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 19 deletions.
50 changes: 35 additions & 15 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,30 +50,50 @@ jobs:
ignore_empty: true
ignore_missing: true

- name: Deploy to Netlify hosting
# - name: Deploy to Netlify hosting
# env:
# NETLIFY_AUTH_TOKEN: ${{secrets.NETLIFY_AUTH_TOKEN}}
# NETLIFY_SITE_ID: ${{secrets.NETLIFY_SITE_ID_PROD}}
# NODE_VERSION: "20.x"
# run: |
# npx netlify --telemetry-disable
# netlify deploy --build --prod
#
# - name: Deploy to Vercel hosting
# env:
# VERCEL_TOKEN: ${{secrets.VERCEL_TOKEN}}
# VERCEL_ORG_ID: ${{secrets.VERCEL_ORG_ID}}
# VERCEL_PROJECT_ID: ${{secrets.VERCEL_PROJECT_ID}}
# run: |
# npx vercel telemetry disable
# npx vercel pull --yes --environment=production --token=$VERCEL_TOKEN
# npx vercel build --prod --token=$VERCEL_TOKEN
# npx vercel deploy --prod --prebuilt --archive=tgz --token=$VERCEL_TOKEN >deployment-url.txt 2>error.txt
# code=$?
# if [ $code -eq 0 ]; then
# # Now you can use the deployment url from stdout for the next step of your workflow
# deploymentUrl=`cat deployment-url.txt`
# npx vercel alias $deploymentUrl coh3stats.com --token=$VERCEL_TOKEN --scope cohstats
# else
# # Handle the error
# errorMessage=`cat error.txt`
# echo "There was an error: $errorMessage"
# fi
- name: Deploy to Vercel hosting - PV org
env:
NETLIFY_AUTH_TOKEN: ${{secrets.NETLIFY_AUTH_TOKEN}}
NETLIFY_SITE_ID: ${{secrets.NETLIFY_SITE_ID_PROD}}
NODE_VERSION: "20.x"
run: |
npx netlify --telemetry-disable
netlify deploy --build --prod
- name: Deploy to Vercel hosting
env:
VERCEL_TOKEN: ${{secrets.VERCEL_TOKEN}}
VERCEL_ORG_ID: ${{secrets.VERCEL_ORG_ID}}
VERCEL_PROJECT_ID: ${{secrets.VERCEL_PROJECT_ID}}
VERCEL_TOKEN: ${{secrets.VERCEL_DEPLOY_TOKEN_PV}}
VERCEL_ORG_ID: ${{secrets.VERCEL_ORG_ID_PV}}
VERCEL_PROJECT_ID: ${{secrets.VERCEL_PROJECT_ID_PV}}
run: |
npx vercel telemetry disable
npx vercel pull --yes --environment=production --token=$VERCEL_TOKEN
npx vercel build --prod --token=$VERCEL_TOKEN
npx vercel deploy --prod --prebuilt --token=$VERCEL_TOKEN >deployment-url.txt 2>error.txt
npx vercel deploy --prod --prebuilt --archive=tgz --token=$VERCEL_TOKEN >deployment-url.txt 2>error.txt
code=$?
if [ $code -eq 0 ]; then
# Now you can use the deployment url from stdout for the next step of your workflow
deploymentUrl=`cat deployment-url.txt`
npx vercel alias $deploymentUrl coh3stats.com --token=$VERCEL_TOKEN --scope cohstats
npx vercel alias $deploymentUrl coh3stats.com --token=$VERCEL_TOKEN --scope petrveceras-projects
else
# Handle the error
errorMessage=`cat error.txt`
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ jobs:
VERCEL_PROJECT_ID: ${{secrets.VERCEL_PROJECT_ID_PV}}
run: |
npx vercel telemetry disable
npx vercel pull --yes --environment=production --token=$VERCEL_TOKEN
npx vercel build --prod --token=$VERCEL_TOKEN
npx vercel deploy --prod --prebuilt --token=$VERCEL_TOKEN >deployment-url.txt 2>error.txt
npx vercel pull --yes --environment=preview --token=$VERCEL_TOKEN
npx vercel build --token=$VERCEL_TOKEN
npx vercel deploy --prebuilt --archive=tgz --token=$VERCEL_TOKEN >deployment-url.txt 2>error.txt
code=$?
if [ $code -eq 0 ]; then
# Now you can use the deployment url from stdout for the next step of your workflow
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
# On vercel, development env is what we used to call preview
npx vercel pull --yes --environment=development --token=$VERCEL_TOKEN
npx vercel build --token=$VERCEL_TOKEN
npx vercel deploy --prebuilt --token=$VERCEL_TOKEN >deployment-url.txt 2>error.txt
npx vercel deploy --prebuilt --archive=tgz --token=$VERCEL_TOKEN >deployment-url.txt 2>error.txt
code=$?
if [ $code -eq 0 ]; then
# Now you can use the deployment url from stdout for the next step of your workflow
Expand Down

0 comments on commit 635421a

Please sign in to comment.