-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathaction.yml
More file actions
43 lines (36 loc) · 1.43 KB
/
action.yml
File metadata and controls
43 lines (36 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: "Cache Magento 2 for Pipeline"
author: "Graycore"
description: "A Github Action that creates a composer cache for a Magento extension or store."
inputs:
composer_cache_key:
required: false
default: "__mageos"
description: A key to version the composer cache. Can be incremented if you need to bust the cache.
outputs:
cache-hit:
description: "A boolean value to indicate an exact match was found for the key"
value: ${{ steps.cache-magento-cache.outputs.cache-hit }}
runs:
using: "composite"
steps:
- name: Get Composer Cache Directory
shell: bash
id: cache-magento-composer-cache
run: |
echo "dir=$(composer config cache-files-dir --global)" >> $GITHUB_OUTPUT
- run: echo "version=$(php -v | awk 'NR==1{print $2}')" >> "$GITHUB_OUTPUT"
shell: bash
id: cache-magento-get-php-version
- run: echo "version=$(composer --version | awk '{print $3}')" >> "$GITHUB_OUTPUT"
shell: bash
name: Compute Composer Version
id: cache-magento-get-composer-version
- name: "Cache Composer Packages"
uses: actions/cache@v5
id: cache-magento-cache
with:
key: "composer | v5.8 | ${{ inputs.composer_cache_key }} | ${{ steps.cache-magento-get-composer-version.outputs.version }} | ${{ steps.cache-magento-get-php-version.outputs.version }}"
path: ${{ steps.cache-magento-composer-cache.outputs.dir }}
branding:
icon: "code"
color: "green"