mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 19:48:50 +03:00
Configured storing Nx cache in GHA to speed up builds
refs https://github.com/TryGhost/DevOps/issues/47 - this allows us to store and restore the cache for TS builds, which should speed up the whole process
This commit is contained in:
parent
0be06f0237
commit
e990cbba01
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
@ -20,6 +20,10 @@ env:
|
||||
~/.cache/ms-playwright/
|
||||
CACHED_BUILD_PATHS: |
|
||||
${{ github.workspace }}/ghost/*/build
|
||||
NX_CACHE_RESTORE_KEYS: |
|
||||
nx-Linux-${{ github.ref }}-${{ github.sha }}
|
||||
nx-Linux-${{ github.ref }}
|
||||
nx-Linux
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.head_ref || github.run_id }}
|
||||
@ -100,7 +104,7 @@ jobs:
|
||||
changed_any_code: ${{ steps.changed.outputs.any-code }}
|
||||
base_commit: ${{ env.BASE_COMMIT }}
|
||||
is_canary_branch: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/arch') }}
|
||||
is_git_sync: ${{ github.head_ref == 'main' || github.ref == 'refs/heads/main' }}
|
||||
is_main: ${{ github.ref == 'refs/heads/main' }}
|
||||
|
||||
job_install_deps:
|
||||
name: Install Dependencies
|
||||
@ -117,6 +121,14 @@ jobs:
|
||||
id: compute_lockfile_hash
|
||||
run: echo "hash=${{ hashFiles('yarn.lock') }}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Nx cache
|
||||
uses: actions/cache@v3
|
||||
id: cache_nx
|
||||
with:
|
||||
path: .nxcache
|
||||
key: nx-Linux-${{ github.ref }}-${{ env.HEAD_COMMIT }}
|
||||
restore-keys: ${{needs.job_get_metadata.outputs.is_main == 'false' && env.NX_CACHE_RESTORE_KEYS || 'nx-never-restore'}}
|
||||
|
||||
- name: Check dependency cache
|
||||
uses: actions/cache@v3
|
||||
id: cache_dependencies
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -48,6 +48,9 @@ typings/
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Nx cache
|
||||
.nxcache
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user