diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 12f405123c..1f78634a3c 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -48,7 +48,7 @@ jobs: key: ${{ runner.os }}-fe-build-${{ hashFiles('**/yarn.lock') }} - name: Install dependencies if: steps.node-modules-cache.outputs.cache-hit != 'true' - run: make yarn-install + run: make frontend-install - name: build run: make frontend lint: @@ -72,7 +72,7 @@ jobs: key: ${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-node-modules-${{ hashFiles('**/yarn.lock') }} - name: Install dependencies if: steps.node-modules-cache.outputs.cache-hit != 'true' - run: make yarn-install + run: make frontend-install - name: Compile packages run: yarn run compile:dev working-directory: ${{ env.FRONTEND_DIR }} @@ -135,7 +135,7 @@ jobs: ${{ runner.os }}-go-build- - name: Install dependencies if: steps.node-modules-cache.outputs.cache-hit != 'true' - run: make yarn-install + run: make frontend-install - name: Compile packages run: yarn run compile:dev working-directory: ${{ env.FRONTEND_DIR }} @@ -169,7 +169,7 @@ jobs: key: ${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-node-modules-${{ hashFiles('**/yarn.lock') }} - name: Install dependencies if: steps.node-modules-cache.outputs.cache-hit != 'true' - run: make yarn-install + run: make frontend-install - name: Compile packages run: yarn run compile:dev working-directory: ${{ env.FRONTEND_DIR }} @@ -199,7 +199,7 @@ jobs: key: ${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-node-modules-${{ hashFiles('**/yarn.lock') }} - name: Install dependencies if: steps.node-modules-cache.outputs.cache-hit != 'true' - run: make yarn-install + run: make frontend-install - name: Set Publish Auth run: yarn config set npmAuthToken $NODE_AUTH_TOKEN working-directory: ${{ env.FRONTEND_DIR }} diff --git a/tools/scaffolding/templates/gateway/Makefile b/tools/scaffolding/templates/gateway/Makefile index fd20bd2360..95bc82f116 100644 --- a/tools/scaffolding/templates/gateway/Makefile +++ b/tools/scaffolding/templates/gateway/Makefile @@ -35,11 +35,11 @@ backend-with-assets: frontend cd backend && go run $(PRIMARY_MODULE_DIR)/cmd/assets/generate.go ../frontend/build && go build -tags withAssets -o ../build/clutch -ldflags="-X main.version=$(VERSION)" .PHONY: frontend -frontend: yarn-install +frontend: frontend-install $(YARN) --cwd frontend build -.PHONY: yarn-install -yarn-install: yarn-ensure +.PHONY: frontend-install +frontend-install : yarn-ensure ifneq ("$(wildcard frontend/yarn.lock)","") $(YARN) --cwd frontend install --immutable else @@ -51,5 +51,5 @@ yarn-ensure: @$(SHELL) $(TOOLS_MODULE_DIR)/install-yarn.sh .PHONY: frontend-dev # Start the frontend in development mode. -frontend-dev: yarn-ensure yarn-install +frontend-dev: yarn-ensure frontend-install $(YARN) --cwd frontend start