diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 74fd80e7e970..7cae4890e121 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -19,21 +19,22 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Setup volta - uses: volta-cli/action@v4 - - - name: Get npm cache directory path - id: npm-cache-dir-path - shell: bash # To ensure that Windows correctly ouputs the cache path - run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT + - name: Read volta info + id: volta + uses: zoexx/github-action-json-file-properties@release + with: + file_path: 'gui/package.json' + prop_path: 'volta' - - name: Cache npm dependencies - uses: actions/cache@v3 + - name: Setup node + uses: actions/setup-node@v3 with: - path: ${{ steps.npm-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-npm- + node-version: ${{ steps.volta.outputs.node }} + cache: 'npm' + cache-dependency-path: gui/package-lock.json + + - name: Update NPM + run: npm i -g npm@${{ steps.volta.outputs.npm }} - name: Install dependencies working-directory: gui diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index 2eb424aab4f0..b7765debe6ea 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -16,20 +16,22 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: Setup volta - uses: volta-cli/action@v4 - - - name: Get npm cache directory path - id: npm-cache-dir-path - run: echo "::set-output name=dir::$(npm config get cache)" + - name: Read volta info + id: volta + uses: zoexx/github-action-json-file-properties@release + with: + file_path: 'gui/package.json' + prop_path: 'volta' - - name: Cache npm dependencies - uses: actions/cache@v3 + - name: Setup node + uses: actions/setup-node@v3 with: - path: ${{ steps.npm-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-npm- + node-version: ${{ steps.volta.outputs.node }} + cache: 'npm' + cache-dependency-path: gui/package-lock.json + + - name: Update NPM + run: npm i -g npm@${{ steps.volta.outputs.npm }} - name: Install JS dependencies working-directory: gui