Final deployment ready: Complete project with Docker, GitHub Pages, a… #1
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 CR Chatbot to GitHub Pages | |
| on: | |
| # Trigger the workflow on push to main branch | |
| push: | |
| branches: [ main ] | |
| # Allow manual workflow dispatch | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| # Build job | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Copy chatbot files to build directory | |
| run: | | |
| mkdir -p _site | |
| cp -r cr-chatbot/* _site/ | |
| # Create a simple index redirect for root access | |
| cat > _site/../index.html << 'EOF' | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>CR Chatbot - Redirecting...</title> | |
| <meta http-equiv="refresh" content="0; url=./cr-chatbot/"> | |
| <link rel="canonical" href="./cr-chatbot/"> | |
| </head> | |
| <body> | |
| <p>Redirecting to <a href="./cr-chatbot/">CR Chatbot</a>...</p> | |
| </body> | |
| </html> | |
| EOF | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: '.' | |
| # Deployment job | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |