Merge pull request #1 from RoboPIL/gh-pages #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: [ main ] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Git checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Use Node 12.x | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: 12.x | |
| - name: Install Dependencies | |
| run: npm install | |
| - name: Build | |
| run: npm run build | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| - name: Prepare Deployment | |
| run: | | |
| # Create a new directory for deployment | |
| mkdir -p deploy | |
| # Copy only the necessary files | |
| cp -r index.html dist deploy/ | |
| # Create .nojekyll to bypass Jekyll processing | |
| touch deploy/.nojekyll | |
| - name: Deploy to GitHub Pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: deploy | |
| branch: gh-pages | |
| clean: true | |
| token: ${{ secrets.GITHUB_TOKEN }} |