diff --git a/.github/actions/download-node-modules-and-artifacts/action.yml b/.github/actions/download-node-modules-and-artifacts/action.yml index a61404aa3a..15565ccacc 100644 --- a/.github/actions/download-node-modules-and-artifacts/action.yml +++ b/.github/actions/download-node-modules-and-artifacts/action.yml @@ -3,17 +3,33 @@ description: "Download build artifacts" runs: using: "composite" steps: - - name: download and extract artifacts from s3 - shell: bash - env: - REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ github.run_id }}" - run: | - packages=( dist nxcache node_modules ) - for i in "${packages[@]}"; do - time aws s3 cp --no-progress s3://${S3_BUILD_BUCKET_SHORT_NAME}/${REMOTE_PATH}/$i.tar.gz $i.tar.gz - du -h $i.tar.gz - time tar xzf $i.tar.gz - done + - name: Restore dist from cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: dist + key: dist-${{ github.run_id }}-${{ github.run_attempt }} + restore-keys: | + dist-${{ github.run_id }}- + fail-on-cache-miss: true + + - name: Restore nxcache from cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: nxcache + key: nxcache-${{ github.run_id }}-${{ github.run_attempt }} + restore-keys: | + nxcache-${{ github.run_id }}- + fail-on-cache-miss: true + + - name: Restore node_modules from cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: node_modules + key: node-modules-${{ github.run_id }}-${{ github.run_attempt }} + restore-keys: | + node-modules-${{ github.run_id }}- + fail-on-cache-miss: true + - name: show files shell: bash run: | @@ -24,4 +40,4 @@ runs: echo "====NXCACHE====" find nxcache -maxdepth 1 -type d echo "====ADF====" - find node_modules/@alfresco/ -maxdepth 1 -type d \ No newline at end of file + find node_modules/@alfresco/ -maxdepth 1 -type d diff --git a/.github/actions/upload-node-modules-and-artifacts/action.yml b/.github/actions/upload-node-modules-and-artifacts/action.yml index f482168d41..eacd308c4c 100644 --- a/.github/actions/upload-node-modules-and-artifacts/action.yml +++ b/.github/actions/upload-node-modules-and-artifacts/action.yml @@ -4,16 +4,22 @@ description: "Upload build artifacts" runs: using: "composite" steps: - - name: tar and upload artifacts - shell: bash - env: - REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ github.run_id }}" - run: | - packages=( dist nxcache node_modules ) - for i in "${packages[@]}"; do - time tar czf $i.tar.gz $i - du -h $i.tar.gz - time aws s3 cp --no-progress $i.tar.gz "s3://${S3_BUILD_BUCKET_SHORT_NAME}/${REMOTE_PATH}/$i.tar.gz" - done + - name: Save dist to cache + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: dist + key: dist-${{ github.run_id }}-${{ github.run_attempt }} + + - name: Save nxcache to cache + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: nxcache + key: nxcache-${{ github.run_id }}-${{ github.run_attempt }} + + - name: Save node_modules to cache + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: node_modules + key: node-modules-${{ github.run_id }}-${{ github.run_attempt }}