From 59310c5453d27b2c60f0dbac0473e131458f3db4 Mon Sep 17 00:00:00 2001 From: QuirinEcker Date: Tue, 6 May 2025 19:52:13 +0200 Subject: [PATCH] Added Pipeline for deploying to github actions (#1) * added deployment for frontent github pages * whitelisted feature branch for now * added 404.vue page and adjusted config * building now with github pages preset * set fallback option to true * set target option * removing env for now * added root page * added deploy * adjusted workflow * removed options --- .github/workflows/pages.yml | 44 +++++++++++++++++++++++++++++++++++++ web/nuxt.config.ts | 11 ++++++---- web/pages/404.vue | 12 ++++++++++ web/pages/index.vue | 12 ++++++++++ 4 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/pages.yml create mode 100644 web/pages/404.vue create mode 100644 web/pages/index.vue diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..d7b0f4d --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,44 @@ +name: Deploy to GitHub Pages + +on: + workflow_dispatch: + push: + branches: + - main + - feature/github-pages + +jobs: + build: + runs-on: ubuntu-latest + container: + image: oven/bun:1 # Use Bun's official Docker image + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies with Bun + working-directory: ./web + run: bun install + + - name: Build with Nuxt + working-directory: ./web + run: bunx nuxt build --preset github_pages + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./web/.output/public + + deploy: + needs: build + permissions: + pages: write + id-token: write + environment: + name: github_pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + diff --git a/web/nuxt.config.ts b/web/nuxt.config.ts index 5932eec..221e451 100644 --- a/web/nuxt.config.ts +++ b/web/nuxt.config.ts @@ -1,6 +1,9 @@ // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ - compatibilityDate: '2024-11-01', - devtools: { enabled: true }, - modules: ['@nuxt/eslint', '@nuxt/test-utils', '@nuxt/ui'] -}) \ No newline at end of file + compatibilityDate: '2024-11-01', + devtools: { enabled: true }, + modules: ['@nuxt/eslint', '@nuxt/test-utils', '@nuxt/ui'], + app: { + baseURL: process.env.BASE_URL, + }, +}) diff --git a/web/pages/404.vue b/web/pages/404.vue new file mode 100644 index 0000000..537eda6 --- /dev/null +++ b/web/pages/404.vue @@ -0,0 +1,12 @@ + + + + + + diff --git a/web/pages/index.vue b/web/pages/index.vue new file mode 100644 index 0000000..af75d86 --- /dev/null +++ b/web/pages/index.vue @@ -0,0 +1,12 @@ + + + + + +