From 270f6a054acad742b040f5f5d55d7c9047fa109a Mon Sep 17 00:00:00 2001 From: Jamie Schouten Date: Sat, 14 Sep 2024 10:36:18 +0000 Subject: [PATCH] Add action.yml --- action.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..f72a844 --- /dev/null +++ b/action.yml @@ -0,0 +1,32 @@ +name: Setup composer +description: Install and cache composer dependencies +author: Jamie Schouten +inputs: + file: + description: 'file to hash for cache key' + required: false + default: 'composer.lock' + +runs: + using: "composite" + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Auth registry + run: composer config --global http-basic.git.qlic.nl ${{ secrets.REGISTRY_USERNAME }} ${{ secrets.REGISTRY_PASSWORD }} + + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/${{ inputs.file }}') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Install dependencies + run: composer install