Skip to content

Commit

Permalink
fix yarn cache
Browse files Browse the repository at this point in the history
  • Loading branch information
pangbo13 committed Sep 4, 2024
1 parent d050851 commit 72a0352
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/discourse-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
required: false

concurrency:
group: discourse-plugin-${{ format('{0}-{1}', github.head_ref || github.run_number, github.job) }}
group: discourse-plugin-${{ format('{0}-{1}-{2}', github.head_ref || github.run_number, github.job, inputs.core_ref) }}
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -146,6 +146,7 @@ jobs:
PGUSER: discourse
PGPASSWORD: discourse
PLUGIN_NAME: ${{ inputs.name || github.event.repository.name }}
CHEAP_SOURCE_MAPS: "1"

strategy:
fail-fast: false
Expand Down Expand Up @@ -226,19 +227,20 @@ jobs:

- name: Get yarn cache directory
id: yarn-cache-dir
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
run: if [ -f yarn.lock ]; then echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT; fi

- name: Yarn cache
uses: actions/cache@v4
id: yarn-cache
if: ${{ steps.yarn-cache-dir.outputs.dir }}
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn install
run: yarn install
- name: Install JS Dependencies
run: if [ -f yarn.lock ]; then yarn install; else pnpm install; fi

- name: Fetch app state cache
uses: actions/cache@v4
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/plugin-compacity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
PGUSER: discourse
PGPASSWORD: discourse
USES_PARALLEL_DATABASES: ${{ matrix.build_type == 'backend' || matrix.build_type == 'system' }}
CHEAP_SOURCE_MAPS: "1"

strategy:
fail-fast: false
Expand Down Expand Up @@ -138,19 +139,20 @@ jobs:

- name: Get yarn cache directory
id: yarn-cache-dir
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
run: if [ -f yarn.lock ]; then echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT; fi

- name: Yarn cache
uses: actions/cache@v4
id: yarn-cache
if: ${{ steps.yarn-cache-dir.outputs.dir }}
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn install
run: yarn install
- name: Install JS Dependencies
run: if [ -f yarn.lock ]; then yarn install; else pnpm install; fi

- name: Fetch app state cache
uses: actions/cache@v4
Expand Down

0 comments on commit 72a0352

Please sign in to comment.