feat(docs): enhance app documentation with realtime sync recording #11
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 / CD Pipeline for TaskNexus App | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| setup: | |
| name: 🛠️ Setup | |
| runs-on: ubuntu-latest | |
| outputs: | |
| cache-hit: ${{ steps.cache-node.outputs.cache-hit }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| cache: "npm" | |
| - name: Cache node modules | |
| id: cache-node | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Install dependencies | |
| run: npm ci | |
| lint: | |
| name: 🔍 Lint & Format | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Restore cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.npm | |
| key: ${{ needs.setup.outputs.cache-hit }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run Prettier | |
| run: npm run format | |
| - name: Run ESLint | |
| run: npm run lint | |
| test: | |
| name: ✅ Run Tests | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run Jest | |
| run: npm test -- --ci --silent | |
| coverage: | |
| name: 📊 Coverage & Artifact | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run coverage | |
| run: npm run test:coverage -- --ci | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage/ | |
| ts-build: | |
| name: 📦 Package & Build App | |
| runs-on: ubuntu-latest | |
| needs: coverage | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Pack npm module | |
| run: npm pack | |
| - name: Upload npm package artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: npm-package | |
| path: "*.tgz" | |
| docker: | |
| name: 🐳 Docker → GHCR (Node) | |
| runs-on: ubuntu-latest | |
| needs: ts-build | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build & push Node image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository_owner }}/task-manager-reactnative:${{ github.sha }} | |
| ghcr.io/${{ github.repository_owner }}/task-manager-reactnative:latest | |
| docker-ruby: | |
| name: 🐳 Docker → GHCR (Ruby) | |
| runs-on: ubuntu-latest | |
| needs: ts-build | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build & push Ruby image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./ruby | |
| file: ./ruby/Dockerfile | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository_owner }}/task-manager-reactnative-ruby:${{ github.sha }} | |
| ghcr.io/${{ github.repository_owner }}/task-manager-reactnative-ruby:latest | |
| deploy: | |
| name: 🚀 Deploy | |
| runs-on: ubuntu-latest | |
| needs: | |
| - docker | |
| - docker-ruby | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Decode & run deploy script | |
| env: | |
| DEPLOY_B64: ${{ secrets.DEPLOY }} | |
| run: | | |
| echo "$DEPLOY_B64" | base64 --decode > deploy.sh | |
| chmod +x deploy.sh | |
| ./deploy.sh | |
| - name: Announce deployment | |
| run: echo "✅ Deployment complete!" | |
| done: | |
| name: "🎉 Pipeline Done" | |
| needs: [ deploy ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: echo "✅ CI/CD pipeline completed successfully." |