Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions .github/actions/npm-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,36 @@ inputs:
description: "Path for package-lock.json"
required: false
default: "**/package-lock.json"
outputs:
cache-hit:
description: "A boolean value to indicate an exact match was found for the primary key"
value: ${{ steps.set-cache.outputs.cache-hit }}
nodeVersion:
description: "Node version"
required: false
default: "18"
runs:
using: "composite"
steps:
- name: Setup node equally to our local development version
- name: 🆙 Setup node
# pick the Node version to use and install it
# https://github.com/actions/setup-node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: ${{ inputs.nodeVersion }}

- name: Display node and npm version
shell: bash
run: |
node --version
npm --version

- name: Init Cache
- name: 🆒 Init Cache
uses: actions/cache@v3
id: "npm-cache"
id: "cache"
with:
path: ${{ inputs.nodeModulesPath }}
key: ${{ runner.os }}-node-${{ hashFiles(inputs.packageLockPath) }}
key: ${{ runner.os }}-node-${{ inputs.nodeVersion }}-${{ hashFiles(inputs.packageLockPath) }}
restore-keys: |
${{ runner.os }}-node-
${{ runner.os }}-node-${{ inputs.nodeVersion }}

- name: 🥊 Set cache-hit
id: "set-cache"
run: echo "cache-hit=$CACHE_HIT" >> $GITHUB_OUTPUT
- name: ⏬ NPM ci
shell: bash
env:
CACHE_HIT: ${{steps.npm-cache.outputs.cache-hit}}
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
6 changes: 3 additions & 3 deletions .github/scripts/cleanup-gh-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const TAG = 'cleanup-gh-pages:';
const removeOldFromPath = (isTag, data) => {
const path = `public/${isTag ? 'version' : 'review'}`;
if (FS.existsSync(path) && data?.length > 0) {
const dirsToDelete = FS.readdirSync(path).filter(
(file) => !data.find((branch) => branch.name === file)
);
const dirsToDelete = FS.readdirSync(path)
.filter((file) => !data.find((branch) => branch.name === file))
.filter((file) => file !== 'main');
if (dirsToDelete?.length > 0) {
console.log(
TAG,
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/00-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,8 @@ jobs:
uses: actions/checkout@v3

- name: 🔄 Init Cache Default
id: "npm-cache"
uses: ./.github/actions/npm-cache

- name: 🎄🥊 Log cache-hit
run: echo $CACHE_HIT
shell: bash
env:
CACHE_HIT: ${{steps.npm-cache.outputs.cache-hit}}

- name: 📥 Download deps default-npm-cache
if: steps.npm-cache.outputs.cache-hit != 'true'
uses: bahmutov/npm-install@v1

- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
Expand Down