Merge pull request #76 from ilramdhan/fix/calc-engine-aug-10-2026 #21
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 CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| env: | |
| NODE_VERSION: '20' | |
| jobs: | |
| lint-and-build: | |
| name: Lint & Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| - name: Type check | |
| run: npx tsc --noEmit | |
| - name: Build | |
| run: npm run build | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nextjs-build | |
| path: .next/ | |
| retention-days: 1 | |
| docker: | |
| name: Docker Build & Push | |
| runs-on: ubuntu-latest | |
| needs: lint-and-build | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| permissions: | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/mutugading/goapps-frontend | |
| tags: | | |
| type=sha,prefix= | |
| type=ref,event=branch | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| deploy-staging: | |
| name: Deploy to Staging | |
| runs-on: [self-hosted, staging, goapps-runner] | |
| needs: docker | |
| environment: | |
| name: staging | |
| url: https://staging-goapps.mutugading.com | |
| steps: | |
| - name: Notify ArgoCD | |
| run: | | |
| echo "Frontend staging deployment triggered" | |
| echo "Image: ghcr.io/mutugading/goapps-frontend:${{ github.sha }}" | |
| deploy-production: | |
| name: Deploy to Production | |
| runs-on: [self-hosted, production, goapps-runner] | |
| needs: deploy-staging | |
| environment: | |
| name: production | |
| url: https://goapps.mutugading.com | |
| steps: | |
| - name: Deploy via ArgoCD | |
| run: | | |
| echo "Frontend production deployment triggered" | |
| echo "Image: ghcr.io/mutugading/goapps-frontend:${{ github.sha }}" | |