From ce8bb6bf25901e63bc97d0d7f8956e8efc266711 Mon Sep 17 00:00:00 2001 From: tplevko Date: Fri, 8 Sep 2023 07:40:41 +0200 Subject: [PATCH] Add gh pages workflow --- .github/workflows/deploy-to-gh-pages.yml | 46 ++++++++++++++++++++++++ packages/ui/vite.config.cjs | 1 + 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/deploy-to-gh-pages.yml diff --git a/.github/workflows/deploy-to-gh-pages.yml b/.github/workflows/deploy-to-gh-pages.yml new file mode 100644 index 000000000..0bf22b33f --- /dev/null +++ b/.github/workflows/deploy-to-gh-pages.yml @@ -0,0 +1,46 @@ +name: Build and Deploy to GH pages +on: + push: + branches: + - main + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: 'Checkout source code' + uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + scope: '@kaoto' + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + - name: 🛰️ Setup Pages + uses: actions/configure-pages@v3 + - name: 🔧 Install dependencies + run: yarn + - name: Build @kaoto-next/ui web application + run: yarn workspace @kaoto-next/ui run build + - name: 📤 Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: 'packages/ui/dist/webapp' + - name: 🚀 Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/packages/ui/vite.config.cjs b/packages/ui/vite.config.cjs index 5eb2099b9..fd4be831f 100644 --- a/packages/ui/vite.config.cjs +++ b/packages/ui/vite.config.cjs @@ -13,6 +13,7 @@ export default defineConfig({ sourcemap: true, emptyOutDir: true, }, + base: './', }); /**