Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] The default deploy action of static react project breaks if I use npm instead of yarn. #306

Open
tianzhich opened this issue Dec 13, 2023 · 1 comment

Comments

@tianzhich
Copy link

tianzhich commented Dec 13, 2023

The default deploy action is as follows:

name: Npm deployment

on:
  push:
    branches:
      - main

jobs:
  Deploy:
    runs-on: ubuntu-latest

    if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"

    steps:
      - name: Checkout repo
        uses: actions/checkout@v2

      - name: Use Node.js v16
        uses: actions/setup-node@v2
        with:
          node-version: 16

      - name: Set yarn cache
        uses: c-hive/gha-yarn-cache@v2

      - name: Init
        run: make github-action-init

      - name: Blocklet workflow
        uses: blocklet/action-workflow@v1.1
        with:
          skip-upload: false
          bundle-command: yarn bundle
          store-endpoint: ${{ secrets.STORE_ENDPOINT_DEV }}
          store-access-token: ${{ secrets.STORE_ACCESS_TOKEN_DEV }}
          github-token: ${{ secrets.GITHUB_TOKEN }}

It breaks on the step Set yarn cache:

image

I suggest that we could use action/setup-node to cache the dependencies. It supports multiple package managers and uses action/cache under the hood.

@LancelotLewis
Copy link
Collaborator

you might need change this ci workflow to pnpm version
which should be like this

name: Npm deployment

on:
  push:
    branches:
      - main

jobs:
  Deploy:
    runs-on: ubuntu-latest

    if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"

    steps:
      - name: Checkout repo
        uses: actions/checkout@v2

      - uses: pnpm/action-setup@v2.0.1
        with:
          version: latest
      - name: Use Node.js 16
        uses: actions/setup-node@v2
        with:
          node-version: "16"
          cache: "pnpm"

      - name: Init
        run: make github-action-init

      - name: Blocklet workflow
        uses: blocklet/action-workflow@v1.1
        with:
          skip-upload: false
          bundle-command: pnpm bundle
          store-endpoint: ${{ secrets.STORE_ENDPOINT_DEV }}
          store-access-token: ${{ secrets.STORE_ACCESS_TOKEN_DEV }}
          github-token: ${{ secrets.GITHUB_TOKEN }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants