Original attribution #7
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: Frontend Build CD | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20' | |
| - name: Build frontend | |
| run: | | |
| cd frontend | |
| npm ci | |
| npm run build | |
| env: | |
| VITE_GOOGLE_API_KEY: ${{ secrets.VITE_GOOGLE_API_KEY }} | |
| - name: Commit build | |
| run: | | |
| git config --global user.email "github-actions@github.com" | |
| git config --global user.name "GitHub Actions" | |
| git add frontend/dist | |
| git commit -m "Build frontend" || echo "No changes to commit" | |
| git push |