mirror of
https://github.com/ArthurDanjou/artsite.git
synced 2026-01-14 15:54:13 +01:00
fix: mettre à jour la configuration de déploiement Cloudflare et ajuster les règles de route pour l'API
This commit is contained in:
14
.github/workflows/cloudflare.yml
vendored
14
.github/workflows/cloudflare.yml
vendored
@@ -3,7 +3,13 @@ name: Deploy to Cloudflare Pages
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- '**'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
deployments: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
@@ -40,7 +46,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
command: pages deploy
|
command: pages deploy --branch=${{ env.BRANCH_NAME }}
|
||||||
|
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||||
env:
|
env:
|
||||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
|
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
||||||
@@ -97,7 +97,12 @@ export default defineNuxtConfig({
|
|||||||
},
|
},
|
||||||
|
|
||||||
routeRules: {
|
routeRules: {
|
||||||
'/api/activity': { swr: 3 },
|
'/api/activity': {
|
||||||
|
proxy: `${process.env.NUXT_API_URL}/api/activity`
|
||||||
|
},
|
||||||
|
'/api/stats': {
|
||||||
|
proxy: `${process.env.NUXT_API_URL}/api/stats`
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
nitro: {
|
nitro: {
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
export default defineEventHandler(async (event) => {
|
|
||||||
const config = useRuntimeConfig(event)
|
|
||||||
return await $fetch(`${config.api.url}/api/activity`)
|
|
||||||
})
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
export default defineEventHandler(async (event) => {
|
|
||||||
const config = useRuntimeConfig(event)
|
|
||||||
return await $fetch(`${config.api.url}/api/stats`)
|
|
||||||
})
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../.nuxt/tsconfig.server.json"
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user