diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..2ed3167 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,34 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '18.17.0' + + - name: Install dependencies + run: npm install + + - name: Build frontend + run: npm run build + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + + # Deploy to GitHub Pages + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/frontend # This is the directory with the static files to deploy diff --git a/.github/workflows/setEnv.yml b/.github/workflows/setEnv.yml deleted file mode 100644 index dad2b9c..0000000 --- a/.github/workflows/setEnv.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Set Env Vars - -on: - push: - pull_request: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set OpenAI key - env: - super_secret: ${{ secrets.OPENAI_API_KEY }} diff --git a/docker-compose.yml b/docker-compose.yml index c03cdcd..c8e6a4b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,17 +1,16 @@ -version: '3' services: backend: build: context: . dockerfile: Dockerfile - environment: - - OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} ports: - "4013:4013" - + env_file: + - .env + frontend: build: - context: ./frontend + context: ./docs/frontend dockerfile: Dockerfile ports: - "8080:80" diff --git a/frontend/Dockerfile b/docs/frontend/Dockerfile similarity index 100% rename from frontend/Dockerfile rename to docs/frontend/Dockerfile diff --git a/frontend/index.html b/docs/frontend/index.html similarity index 100% rename from frontend/index.html rename to docs/frontend/index.html