feat: trying to optimize builds
This commit is contained in:
16
.github/workflows/default.yaml
vendored
16
.github/workflows/default.yaml
vendored
@@ -20,15 +20,13 @@ jobs:
|
||||
- name: 🔄 Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: 🔢 Calculate cache IDs
|
||||
- name: 🔢 Prepare cache keys
|
||||
run: |
|
||||
# Calculate cache IDs for Git LFS and PNPM
|
||||
# Calculate cache IDs for Git LFS
|
||||
git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
|
||||
LFS_CACHE_ID=$(cat .lfs-assets-id | md5sum)-v1
|
||||
PNPM_CACHE_ID=$(cat pnpm-lock.yaml | md5sum)-v1
|
||||
echo "LFS_CACHE_ID=$LFS_CACHE_ID" >> $GITHUB_ENV
|
||||
echo "PNPM_STORE_PATH=$(pnpm store path)" >> $GITHUB_ENV
|
||||
echo "PNPM_CACHE_ID=$PNPM_CACHE_ID" >> $GITHUB_ENV
|
||||
|
||||
- name: 🗄️ Cache Git LFS objects
|
||||
uses: actions/cache@v4
|
||||
@@ -41,12 +39,16 @@ jobs:
|
||||
with:
|
||||
path: ${{ env.PNPM_STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: 📷 Cache Astro Images
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: node_modules/.astro
|
||||
key: ${{ runner.os }}-astro-v1
|
||||
key: ${{ runner.os }}-astro-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-astro-
|
||||
|
||||
- name: 🔄 Pull Git LFS files
|
||||
run: git lfs pull
|
||||
@@ -70,8 +72,8 @@ jobs:
|
||||
- name: 🚀 Deploy Changed Files via rclone
|
||||
run: |
|
||||
echo "Uploading _astro assets"
|
||||
rclone sync --update -v --progress --size-only --stats 2s --stats-one-line ./dist/_astro sftp-remote:${REMOTE_DIR}/_astro --transfers 4
|
||||
rclone sync --update -v --progress --size-only --fast-list --stats 2s --stats-one-line ./dist/_astro sftp-remote:${REMOTE_DIR}/_astro --transfers 4
|
||||
echo "Uploading the rest"
|
||||
rclone sync --update -v --progress --exclude _astro/** --stats 2s --stats-one-line ./dist/ sftp-remote:${REMOTE_DIR} --transfers 4
|
||||
rclone sync --update -v --progress --exclude _astro/** --fast-list --stats 2s --stats-one-line ./dist/ sftp-remote:${REMOTE_DIR} --transfers 4
|
||||
env:
|
||||
REMOTE_DIR: ${{ vars.REMOTE_DIR }}
|
||||
|
||||
Reference in New Issue
Block a user