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

github-actionsでnode_modulesをキャッシュする #7

Open
Harineko0 opened this issue Feb 25, 2024 · 0 comments
Open

github-actionsでnode_modulesをキャッシュする #7

Harineko0 opened this issue Feb 25, 2024 · 0 comments

Comments

@Harineko0
Copy link
Collaborator

Harineko0 commented Feb 25, 2024

Reference

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v3

      - name: setup-node
        uses: actions/setup-node@v3
        with:
          node-version: 18
          cache: npm
          cache-dependency-path: ./next/package-lock.json

      - name: cache-node-modules
        uses: actions/cache@v3
        id: node_modules_cache_id
        env:
          cache-name: cache-node-modules
        with:
          working-directory: ./next
          path: '**/node_modules'
          key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}

      - name: npm-install
        if: ${{ steps.node_modules_cache_id.outputs.cache-hit != 'true' }}
        run: npm i
        working-directory: ./next
@Harineko0 Harineko0 changed the title github-actionsでnode_modulesをキャッシュ github-actionsでnode_modulesをキャッシュする Feb 25, 2024
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

1 participant