From 4b7b3caa03b9fc66f8bf6c39c9889e3c897886bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A6Ltorio?= Date: Mon, 21 Oct 2024 17:14:24 +0200 Subject: [PATCH] allow pages --- .github/workflows/ghpages.yaml | 55 ++++++++++++++++++++++++++++++++++ README.md | 2 +- package.json | 1 + src/version.json | 4 +-- webpack.config.js | 4 ++- 5 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ghpages.yaml diff --git a/.github/workflows/ghpages.yaml b/.github/workflows/ghpages.yaml new file mode 100644 index 0000000..a16b767 --- /dev/null +++ b/.github/workflows/ghpages.yaml @@ -0,0 +1,55 @@ +name: GHRelease + +on: + push: + branches: + - main + release: + types: [published] + +permissions: + contents: write + pages: write + id-token: write + packages: write + attestations: write + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install dependencies + run: npm install + + - name: Build project + run: | + GROQ_API_KEY=${{ secrets.GROQ_API_KEY }} npm run getGroqModels + npm run build:github-pages + + - name: Upload pages artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload docs directory + path: "dist" + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/README.md b/README.md index 6989516..7f1e322 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # AI Outlook Add-in -This project is an add-in for Microsoft Outlook web that integrates Groq AI or Sambanova AI and Meta Llama model capabilities into your email experience. It allows users to leverage the power of Groq's AI in their daily email interactions. +Welcome to the AI Outlook Add-in, a powerful tool that integrates Groq AI and Sambanova AI capabilities into Microsoft Outlook web, enhancing your email experience. This project aims to provide users with AI-powered assistance in their daily email interactions, making email management more efficient and productive. ## Star the project diff --git a/package.json b/package.json index 188fe06..61f8e40 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ }, "scripts": { "build": "npm run getGroqModels && npx webpack --mode production", + "build:github-pages": "npm run getGroqModels && npx webpack --env website=GITHUB_PAGES --mode production", "build:dev": "webpack --mode development", "dev-server": "webpack serve --mode development", "getGroqModels": "node --import 'data:text/javascript,import { register } from \"node:module\"; import { pathToFileURL } from \"node:url\"; register(\"ts-node/esm\", pathToFileURL(\"./\"));' ./utils/initModels.ts", diff --git a/src/version.json b/src/version.json index 1ba3e76..e02f0dd 100644 --- a/src/version.json +++ b/src/version.json @@ -1,4 +1,4 @@ { - "commit": "6045ac270f9c53c8f5ab3d77503a53e9a1ea7548", - "date": "2024-10-19 09:25:34 +0200" + "commit": "5b02b869d19f435711be5d9fb25595a3b69c41b8", + "date": "2024-10-19 11:28:30 +0200" } \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index b33d4b5..9620734 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -15,7 +15,6 @@ import path from "path"; import { simpleGit } from "simple-git"; const urlDev = "https://localhost:3000/"; -const urlProd = "https://outlook.addin.pp.ua/"; // CHANGE THIS TO YOUR PRODUCTION DEPLOYMENT LOCATION async function generateVersionFile() { const git = simpleGit(); @@ -32,6 +31,9 @@ async function getHttpsOptions() { export default async (env, options) => { const dev = options.mode === "development"; + const urlProd = + env.website === "GITHUB_PAGES" ? "https://sctg-development.github.io/ai-outlook/" : "https://outlook.addin.pp.ua/"; // CHANGE THIS TO YOUR PRODUCTION DEPLOYMENT LOCATION + const config = { devtool: "source-map", entry: {