File tree Expand file tree Collapse file tree 3 files changed +16
-29
lines changed
Expand file tree Collapse file tree 3 files changed +16
-29
lines changed Original file line number Diff line number Diff line change @@ -10,38 +10,36 @@ inputs:
1010 description : " Path for package-lock.json"
1111 required : false
1212 default : " **/package-lock.json"
13- outputs :
14- cache-hit :
15- description : " A boolean value to indicate an exact match was found for the primary key "
16- value : ${{ steps.set-cache.outputs.cache-hit }}
13+ nodeVersion :
14+ description : " Node version "
15+ required : false
16+ default : " 18 "
1717runs :
1818 using : " composite"
1919 steps :
20- - name : Setup node equally to our local development version
20+ - name : 🆙 Setup node
2121 # pick the Node version to use and install it
2222 # https://github.com/actions/setup-node
2323 uses : actions/setup-node@v3
2424 with :
25- node-version : 18
25+ node-version : ${{ inputs.nodeVersion }}
2626
2727 - name : Display node and npm version
2828 shell : bash
2929 run : |
3030 node --version
3131 npm --version
3232
33- - name : ⏬ Init Cache
33+ - name : 🆒 Init Cache
3434 uses : actions/cache@v3
35- id : " npm- cache"
35+ id : " cache"
3636 with :
3737 path : ${{ inputs.nodeModulesPath }}
38- key : ${{ runner.os }}-node-${{ hashFiles(inputs.packageLockPath) }}
38+ key : ${{ runner.os }}-node-${{ inputs.nodeVersion }}-${{ hashFiles(inputs.packageLockPath) }}
3939 restore-keys : |
40- ${{ runner.os }}-node-
40+ ${{ runner.os }}-node-${{ inputs.nodeVersion }}
4141
42- - name : 🥊 Set cache-hit
43- id : " set-cache"
44- run : echo "cache-hit=$CACHE_HIT" >> $GITHUB_OUTPUT
42+ - name : ⏬ NPM ci
4543 shell : bash
46- env :
47- CACHE_HIT : ${{steps. npm-cache.outputs.cache-hit}}
44+ if : steps.cache.outputs.cache-hit != 'true'
45+ run : npm ci
Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ const TAG = 'cleanup-gh-pages:';
88const removeOldFromPath = ( isTag , data ) => {
99 const path = `public/${ isTag ? 'version' : 'review' } ` ;
1010 if ( FS . existsSync ( path ) && data ?. length > 0 ) {
11- const dirsToDelete = FS . readdirSync ( path ) . filter (
12- ( file ) => ! data . find ( ( branch ) => branch . name === file )
13- ) ;
11+ const dirsToDelete = FS . readdirSync ( path )
12+ . filter ( ( file ) => ! data . find ( ( branch ) => branch . name === file ) )
13+ . filter ( ( file ) => file !== 'main' ) ;
1414 if ( dirsToDelete ?. length > 0 ) {
1515 console . log (
1616 TAG ,
Original file line number Diff line number Diff line change 1515 uses : actions/checkout@v3
1616
1717 - name : 🔄 Init Cache Default
18- id : " npm-cache"
1918 uses : ./.github/actions/npm-cache
2019
21- - name : 🎄🥊 Log cache-hit
22- run : echo $CACHE_HIT
23- shell : bash
24- env :
25- CACHE_HIT : ${{steps.npm-cache.outputs.cache-hit}}
26-
27- - name : 📥 Download deps default-npm-cache
28- if : steps.npm-cache.outputs.cache-hit != 'true'
29- uses : bahmutov/npm-install@v1
30-
3120 - name : 💀 Killing me softly
3221 uses : ./.github/actions/cancel-workflow
3322 if : failure()
You can’t perform that action at this time.
0 commit comments