Generate ZIP file #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate ZIP file | |
on: | |
workflow_dispatch: | |
workflow_call: | |
jobs: | |
generate-zip-file: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache node_modules | |
id: cache-node-modules | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Setup node version and npm cache | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
tools: composer:v2 | |
- name: Install Node dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: npm ci --no-optional | |
- name: Generate ZIP file | |
run: npm run build && rm -rf ./woocommerce-gateway-payfast && unzip woocommerce-gateway-payfast.zip -d ./woocommerce-gateway-payfast | |
- name: Use the Upload Artifact GitHub Action | |
uses: actions/upload-artifact@v4 | |
with: | |
name: woocommerce-gateway-payfast | |
path: woocommerce-gateway-payfast/ |