deps: update npm dependencies #1948
Workflow file for this run
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 | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["v*"] | |
| pull_request: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| DO_REGISTRY: registry.digitalocean.com | |
| DO_IMAGE_NAME: ${{ secrets.DIGITALOCEAN_REGISTRY_NAME }}/trendweight | |
| jobs: | |
| checks: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Restore Turbo cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: .turbo | |
| key: turbo-${{ runner.os }}-${{ github.sha }} | |
| restore-keys: | | |
| turbo-${{ runner.os }}- | |
| - name: Lint / Typecheck | |
| run: npm run check:ci | |
| - name: Build | |
| run: npm run build | |
| - name: Test | |
| run: npm test | |
| docker-build: | |
| name: Docker Build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Log in to GitHub Container Registry | |
| if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Log in to DigitalOcean Container Registry | |
| if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ${{ env.DO_REGISTRY }} | |
| username: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
| password: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
| - name: Extract metadata for GitHub Registry | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=ref,event=tag | |
| type=sha | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=raw,value=latest-release,enable=${{ startsWith(github.ref, 'refs/tags/v') }} | |
| - name: Extract metadata for DigitalOcean Registry | |
| id: meta-do | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ${{ env.DO_REGISTRY }}/${{ env.DO_IMAGE_NAME }} | |
| tags: | | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=raw,value=latest-release,enable=${{ startsWith(github.ref, 'refs/tags/v') }} | |
| - name: Get version | |
| id: version | |
| run: | | |
| if [[ $GITHUB_REF == refs/tags/* ]]; then | |
| VERSION=${GITHUB_REF#refs/tags/} | |
| else | |
| VERSION="build-${{ github.run_number }}" | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| provenance: false | |
| push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} | |
| tags: | | |
| ${{ steps.meta.outputs.tags }} | |
| ${{ steps.meta-do.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| build-args: | | |
| VITE_CLERK_PUBLISHABLE_KEY=${{ secrets.VITE_CLERK_PUBLISHABLE_KEY }} | |
| VITE_SUPABASE_URL=${{ secrets.VITE_SUPABASE_URL }} | |
| VITE_SUPABASE_ANON_KEY=${{ secrets.VITE_SUPABASE_ANON_KEY }} | |
| BUILD_TIME=${{ github.event.head_commit.timestamp || github.event.repository.updated_at }} | |
| BUILD_COMMIT=${{ github.sha }} | |
| BUILD_BRANCH=${{ github.ref_name }} | |
| BUILD_VERSION=${{ steps.version.outputs.version }} | |
| BUILD_REPO=${{ github.repository }} |