Skip to content

test

test #523

Workflow file for this run

name: Publish
on: [push, pull_request]
env:
PNPM_VERSION: 8
NODE_VERSION: 20
jobs:
build:
name: build dependencies & create artifact
runs-on: ubuntu-latest
steps:
- name: Get tag
id: get_tag
run: |
echo TAG=$(echo $GITHUB_REF | cut -d / -f 3) >> $GITHUB_OUTPUT
echo MAJOR=$(echo $GITHUB_REF | cut -d / -f 3 | cut -d '.' -f 1) >> $GITHUB_OUTPUT
echo MINOR=$(echo $GITHUB_REF | cut -d / -f 3 | cut -d '.' -f 2) >> $GITHUB_OUTPUT
echo PATCH=$(echo $GITHUB_REF | cut -d / -f 3 | cut -d '.' -f 3) >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
cache-dependency-path: '_dev/pnpm-lock.yaml'
- name: Install & build
working-directory: _dev
env:
VUE_APP_BUILD_VERSION: ${{ steps.get_tag.outputs.MAJOR }}.${{ steps.get_tag.outputs.MINOR }}.${{ steps.get_tag.outputs.PATCH }}
run: |
pnpm install
pnpm -r build
- name: Install dev composer dependencies
run: composer install
- name: Generate index.php
run: vendor/bin/autoindex
- name: Install composer dependencies
run: composer install --no-dev -o
- name: Write .env file with specific CDN URL
run: echo 'PSX_MKTG_WITH_GOOGLE_CDN_URL=https://storage.googleapis.com/psxmarketing-cdn/${{ steps.get_tag.outputs.MAJOR }}.${{ steps.get_tag.outputs.MINOR }}.${{ steps.get_tag.outputs.PATCH }}/js/' >> .env
- name: Debug
run: ls -la
- name: Clean-up project
uses: PrestaShopCorp/[email protected]
with:
paths: 'crowdin.yml'
- name: Create directory with repo name and copy files
run: |
repo_name="${{ github.event.repository.name }}"
mkdir "$repo_name"
shopt -s dotglob nullglob
for file in *; do
if [ "$file" != "$repo_name" ]; then
mv "$file" "$repo_name/"
fi
done
- name: Debug
run: cd ${{github.event.repository.name}} && ls -la