Skip to content

fix runner

fix runner #5521

Workflow file for this run

name: Build & Release draft
on:
pull_request:
push:
branches:
- master
- 2.4.x
- 3.2.x
jobs:
deploy:
name: build dependencies & create artifact
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: 'actions/checkout@v4'
with:
path: ''
- name: Install composer dependencies
run: composer install --no-dev -o
- name: Clean-up project
uses: PrestaShopCorp/[email protected]
- name: Cache module folder
uses: 'actions/cache@v4'
with:
path: ./
key: ${{ github.run_id }}
upload_asset_preproduction:
runs-on: ubuntu-latest
needs: [ deploy ]
if: github.event_name == 'push' || github.event_name == 'pull_request'
steps:
- name: Retrieve from cache module folder
id: retrieve-cache
uses: 'actions/cache@v4'
with:
path: ./
key: ${{ github.run_id }}
- name: Check if retrieved from cache was successful
if: steps.retrieve-cache.outputs.cache-hit != 'true'
run: exit 1
- name: Manually perform GCP CLI authentication
run: |
echo $GOOGLE_JSON_CRED > token.json
gcloud auth activate-service-account --key-file=token.json
rm token.json
env:
GOOGLE_JSON_CRED: ${{ secrets.G_CREDENTIAL_PREPRODUCTION }}
- name: Copy env files
run: |
gcloud secrets versions access latest --project distribution-preprod --secret=mbo-module-env-3x > .env
rm -f .env.dist
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.G_CREDENTIAL_PREPRODUCTION }}
- name: Prepare the zip
run: |
cd ..
zip -r ${{ github.event.repository.name }}.zip ${{ github.event.repository.name }}
- name: Create & upload artifact for preprod
uses: 'actions/upload-artifact@v4'
with:
name: ${{ github.event.repository.name }}.preprod
path: /home/runner/work/ps_mbo/${{ github.event.repository.name }}.zip
upload_release_asset_production:
name: Upload the production zip asset to the release
runs-on: ubuntu-latest
if: github.event_name == 'push'
needs: deploy
steps:
- name: Retrieve from cache module folder
id: retrieve-cache
uses: 'actions/cache@v4'
with:
path: ./
key: ${{ github.run_id }}
- name: Check if retrieved from cache was successful
if: steps.retrieve-cache.outputs.cache-hit != 'true'
run: exit 1
- name: Manually perform GCP CLI authentication
run: |
echo $GOOGLE_JSON_CRED > token.json
gcloud auth activate-service-account --key-file=token.json
rm token.json
env:
GOOGLE_JSON_CRED: ${{ secrets.G_CREDENTIAL_PRODUCTION }}
- name: Copy env files
run: |
rm -f .env.dist
gcloud secrets versions access latest --project distribution-production-308520 --secret=mbo-module-env-3x > .env
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.G_CREDENTIAL_PRODUCTION }}
- name: Remove test settings files
run: |
rm -f ./src/Traits/HaveConfigurationPage.php
sed -i '/HaveConfigurationPage/d' ps_mbo.php
- name: Create & upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}
path: /home/runner/work/ps_mbo/