From 7772d27ce318a6ad18a166c67901a7c5ecc4c8e4 Mon Sep 17 00:00:00 2001 From: Mark Ross Date: Thu, 23 Nov 2023 15:57:20 -0700 Subject: [PATCH] Improved build and deployment configuration (#26) --- .do/app.yaml | 5 ++++- .github/workflows/nuxtjs.yml | 3 ++- README.md | 2 -- components/scoreboard/ScoreboardEmojiButton.vue | 2 +- nuxt.config.ts | 14 +++++--------- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.do/app.yaml b/.do/app.yaml index 6ebc541..1a02ed3 100644 --- a/.do/app.yaml +++ b/.do/app.yaml @@ -13,7 +13,7 @@ ingress: name: lineup match: path: - prefix: /lineup + prefix: / name: lineup-app region: nyc static_sites: @@ -23,6 +23,9 @@ static_sites: - key: NITRO_PRESET scope: BUILD_TIME value: digital-ocean + - key: NUXT_APP_BASE_URL + scope: BUILD_TIME + value: '/' error_document: 404.html github: branch: main diff --git a/.github/workflows/nuxtjs.yml b/.github/workflows/nuxtjs.yml index e5b611c..ad1a4cd 100644 --- a/.github/workflows/nuxtjs.yml +++ b/.github/workflows/nuxtjs.yml @@ -63,10 +63,11 @@ jobs: - name: Static HTML export with Nuxt run: | ${{ steps.detect-package-manager.outputs.manager }} run generate - # this should be taken care of by Nitro with NITRO_PRESET + # this should be taken care of by Nitro with NITRO_PRESET=github_pages #touch ./.output/.nojekyll env: NITRO_PRESET: github_pages + NUXT_APP_BASE_URL: '/lineup/' - name: Upload artifact uses: actions/upload-pages-artifact@v2 with: diff --git a/README.md b/README.md index 5eca6d7..9937c9c 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,6 @@ For a preview of the generated site on http://localhost:3000/, you can run: npm run preview ``` -Note that the preview feature may not work. A workaround is documented [here](https://github.com/nuxt/nuxt/issues/14454#issuecomment-1397357957) but it doesn't seem to help. - ### Publish Firestore Indexes and Security Rules If the Firestore indexes or security rules have changed, they will need to be pushed during deployment of the app. diff --git a/components/scoreboard/ScoreboardEmojiButton.vue b/components/scoreboard/ScoreboardEmojiButton.vue index 0d3a914..3ac5e68 100644 --- a/components/scoreboard/ScoreboardEmojiButton.vue +++ b/components/scoreboard/ScoreboardEmojiButton.vue @@ -15,7 +15,7 @@ const emojiTitle = computed(() => emojiTitles[props.id]);