Merge pull request #50 from techstartucalgary/CI-and-CD-for-frontend #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: CI - Build Frontend | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "shatter-web/**" | |
| - ".github/workflows/ci-frontend.yml" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "shatter-web/**" | |
| - ".github/workflows/ci-frontend.yml" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: | | |
| cd shatter-web | |
| npm ci | |
| - name: Build React app | |
| run: | | |
| cd shatter-web | |
| npm run build | |
| - name: Compress frontend source for artifact | |
| run: | | |
| tar -czf frontend-source-${{ github.run_id }}.tar.gz shatter-web | |
| - name: Upload frontend artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend-source-${{ github.run_id }} | |
| path: frontend-source-${{ github.run_id }}.tar.gz | |