Fix pages env vars (#1230)
* Fix pages env vars * bring back vercel json
This commit is contained in:
parent
4c8c35a25a
commit
6e0f22323b
19
.github/workflows/deploy.yml
vendored
Normal file
19
.github/workflows/deploy.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
name: Deploy
|
||||
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
deployments: write
|
||||
steps:
|
||||
- name: Cloudflare Pages deployment
|
||||
uses: WalshyDev/cf-pages-await@v1
|
||||
with:
|
||||
apiToken: ${{ secrets.CF_API_TOKEN }}
|
||||
accountId: '9ddae624c98677d68d93df6e524a6061'
|
||||
project: 'knossos'
|
||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
commitHash: ${{ steps.push-changes.outputs.commit-hash }}
|
||||
2
.github/workflows/regenerate.yml
vendored
2
.github/workflows/regenerate.yml
vendored
@ -11,4 +11,4 @@ jobs:
|
||||
- name: Re-deploy site
|
||||
run: |
|
||||
curl -X POST \
|
||||
${{ secrets.VERCEL_DEPLOY_URL }}
|
||||
${{ secrets.CLOUDFLARE_DEPLOY_URL }}
|
||||
|
||||
@ -269,8 +269,10 @@ export default defineNuxtConfig({
|
||||
|
||||
owner: process.env.VERCEL_GIT_REPO_OWNER || 'modrinth',
|
||||
slug: process.env.VERCEL_GIT_REPO_SLUG || 'knossos',
|
||||
branch: process.env.VERCEL_GIT_COMMIT_REF || 'master',
|
||||
hash: process.env.VERCEL_GIT_COMMIT_SHA || 'unknown',
|
||||
// @ts-ignore
|
||||
branch: process.env.VERCEL_GIT_COMMIT_REF || globalThis.CF_PAGES_BRANCH || 'master',
|
||||
// @ts-ignore
|
||||
hash: process.env.VERCEL_GIT_COMMIT_SHA || globalThis.CF_PAGES_COMMIT_SHA || 'unknown',
|
||||
},
|
||||
},
|
||||
typescript: {
|
||||
@ -309,6 +311,11 @@ function getDomain() {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
if (process.env.SITE_URL) {
|
||||
return process.env.SITE_URL
|
||||
}
|
||||
// @ts-ignore
|
||||
else if (process.env.CF_PAGES_URL || globalThis.CF_PAGES_URL) {
|
||||
// @ts-ignore
|
||||
return process.env.CF_PAGES_URL ?? globalThis.CF_PAGES_URL
|
||||
} else if (process.env.HEROKU_APP_NAME) {
|
||||
return `https://${process.env.HEROKU_APP_NAME}.herokuapp.com`
|
||||
} else if (process.env.VERCEL_URL) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user