From 8b37aabcfa79171d97366bc1edaec45c421f7a6a Mon Sep 17 00:00:00 2001 From: Bo Robbrecht Date: Wed, 24 Jul 2024 09:19:54 +0200 Subject: [PATCH 1/6] Created CD workflow --- loama/vite.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/loama/vite.config.ts b/loama/vite.config.ts index 2d92c00..f1df99a 100644 --- a/loama/vite.config.ts +++ b/loama/vite.config.ts @@ -7,6 +7,7 @@ import svgLoader from 'vite-svg-loader' // https://vitejs.dev/config/ export default defineConfig({ + base: '/loama/', plugins: [ vue(), vueDevTools(), From 6657c86115a64f0082dd86507242b9fc7216a0a6 Mon Sep 17 00:00:00 2001 From: Bo Robbrecht Date: Wed, 24 Jul 2024 09:22:10 +0200 Subject: [PATCH 2/6] ACTUALLY commited CD workflow --- .github/workflows/cd.yml | 112 +++++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 11 +--- 2 files changed, 113 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..a499cb3 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,112 @@ +name: Loama CD + +on: + push: + branches: [ "root" ] + pull_request: + branches: [ "root" ] + + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: 'pages' + cancel-in-progress: true + +jobs: + controller-build: + name: 'Controller Build' + runs-on: ubuntu-latest + defaults: + run: + working-directory: controller + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + - uses: pnpm/action-setup@v4 + name: Install PNPM + with: + version: latest + run_install: false + - name: Get pnpm store directory + shell: bash + id: cache + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT + - uses: actions/cache@v4 + name: Setup PNPM cache + env: + STORE_PATH: ${{ steps.cache.outputs.STORE_PATH }} + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - name: Insall dependencies + run: pnpm install --frozen-lockfile + - name: Run Typescript Check + run: pnpm run build >> $GITHUB_STEP_SUMMARY + - name: Save distribution files + uses: actions/upload-artifact@v4 + with: + name: controller-dist + path: ${{github.workspace}}/controller/dist + + build: + name: 'Deploy App' + runs-on: ubuntu-latest + needs: controller-build + defaults: + run: + working-directory: loama + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Download controller dist + uses: actions/download-artifact@v4 + with: + name: controller-dist + path: ${{github.workspace}}/controller/dist + - name: Install Node.js + uses: actions/setup-node@v4 + - uses: pnpm/action-setup@v4 + name: Install PNPM + with: + version: latest + run_install: false + - name: Get pnpm store directory + shell: bash + id: cache + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT + - uses: actions/cache@v4 + name: Setup PNPM cache + env: + STORE_PATH: ${{ steps.cache.outputs.STORE_PATH }} + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - name: Install dependencies of controller + working-directory: controller + run: pnpm install --frozen-lockfile + - name: Install dependencies of loama + run: pnpm install --frozen-lockfile + - name: Build applicaion + run: pnpm run build + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload dist folder + path: ${{github.workspace}}/loama/dist + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 139c571..ce339c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,4 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# ESLint is a tool for identifying and reporting on patterns -# found in ECMAScript/JavaScript code. -# More details at https://github.com/eslint/eslint -# and https://eslint.org - -name: AMA ESLint +name: Loama CI on: push: From 0599aac0d92f4b9895baeaf92575265888934c7f Mon Sep 17 00:00:00 2001 From: Bo Robbrecht Date: Wed, 24 Jul 2024 09:52:24 +0200 Subject: [PATCH 3/6] Made sure that callback url & redirect URL are correctly composed --- loama/src/components/LoginForm.vue | 2 +- loama/src/router/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/loama/src/components/LoginForm.vue b/loama/src/components/LoginForm.vue index 94c0fba..760dac4 100644 --- a/loama/src/components/LoginForm.vue +++ b/loama/src/components/LoginForm.vue @@ -52,7 +52,7 @@ const login = () => { store.session.login({ oidcIssuer: issuer, - redirectUrl: new URL('/home/', window.location.href).toString(), + redirectUrl: new URL(`${import.meta.env.BASE_URL}home/`, window.location.href).toString(), clientName: 'LOAMA', }) .then(() => { diff --git a/loama/src/router/index.ts b/loama/src/router/index.ts index b8b4562..edd2fe9 100644 --- a/loama/src/router/index.ts +++ b/loama/src/router/index.ts @@ -9,12 +9,12 @@ const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [ { - path: '/', + path: `/`, name: 'login', component: LoginView }, { - path: '/home/:filePath(.*)', + path: `/home/:filePath(.*)`, name: 'home', component: HomeView } From dbbd29c8e0fd8048a20c055b6b1ad32bd9157661 Mon Sep 17 00:00:00 2001 From: Bo Robbrecht Date: Wed, 24 Jul 2024 10:00:47 +0200 Subject: [PATCH 4/6] Images are served in public folder, instead of compiled --- loama/{src/assets => public}/loama.svg | 0 loama/{src/assets => public}/vault.svg | 0 loama/src/components/explorer/ResourceExplorer.vue | 3 +-- loama/src/components/header/HeaderBase.vue | 3 +-- loama/src/views/LoginView.vue | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) rename loama/{src/assets => public}/loama.svg (100%) rename loama/{src/assets => public}/vault.svg (100%) diff --git a/loama/src/assets/loama.svg b/loama/public/loama.svg similarity index 100% rename from loama/src/assets/loama.svg rename to loama/public/loama.svg diff --git a/loama/src/assets/vault.svg b/loama/public/vault.svg similarity index 100% rename from loama/src/assets/vault.svg rename to loama/public/vault.svg diff --git a/loama/src/components/explorer/ResourceExplorer.vue b/loama/src/components/explorer/ResourceExplorer.vue index 2a9c42a..d1bd860 100644 --- a/loama/src/components/explorer/ResourceExplorer.vue +++ b/loama/src/components/explorer/ResourceExplorer.vue @@ -7,7 +7,7 @@
- + No folder or file selected! Select one to get started
@@ -15,7 +15,6 @@