Skip to content

Commit

Permalink
Merge pull request #9 from GitTerraGame/cache_npm_packages
Browse files Browse the repository at this point in the history
Use cache action to cache NPM packages
  • Loading branch information
sergeychernyshev authored Apr 20, 2024
2 parents 8dd2a62 + dae643c commit 54b3c6c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
22 changes: 21 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,28 @@ runs:
repository: "GitTerraGame/Play-GitTerra-Action"
path: "builders"

- name: Looking for a stash of existing tools
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('builders/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: Check the empty stash
continue-on-error: true
shell: "bash"
run: npm list

- name: Equipping builders with the tools
run: (cd builders && npm install)
run: (cd builders && npm ci)
shell: "bash"

- name: Building the city of GitTerra
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gitterra",
"version": "1.1.1",
"version": "1.1.2",
"description": "A git-based game running in CI/CD and played by coding",
"main": "src/generateMap.js",
"scripts": {
Expand Down

0 comments on commit 54b3c6c

Please sign in to comment.