Add files via upload #4
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 ] # or your default branch name (could be 'master') | |
| workflow_dispatch: # allows manual triggering | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '16' # or your preferred Node.js version | |
| - name: Install dependencies | |
| run: npm install # or yarn install | |
| - name: Build with API key | |
| env: | |
| REACT_APP_API_KEY: ${{ secrets.API_KEY }} # Uses the secret you'll create | |
| run: npm run build # or your build command | |
| - name: Deploy to GitHub Pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: build # or your build output directory (dist, public, etc.) | |
| branch: gh-pages # The branch the action should deploy to |