Send absolute URL for mudule actions #5178
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: Build & Release | |
on: | |
pull_request: | |
types: [opened, reopened] | |
release: | |
types: [released, prereleased] | |
push: | |
branches-ignore: | |
- feat/* | |
- fix/* | |
env: | |
LABELS: ${{toJSON(github.event.pull_request.labels)}} | |
jobs: | |
deploy: | |
name: build dependencies & create artifact | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: 'actions/checkout@v3' | |
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@v3' | |
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@v3' | |
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 > .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@v1' | |
with: | |
name: ${{ github.event.repository.name }}.preprod | |
path: ../${{ 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 == 'release' | |
needs: deploy | |
steps: | |
- name: Retrieve from cache module folder | |
id: retrieve-cache | |
uses: 'actions/cache@v3' | |
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 > .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: Prepare the production zip | |
run: | | |
cd .. | |
zip -r ${{ github.event.repository.name }}.zip ${{ github.event.repository.name }} | |
- name: Publish the production zip | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ../${{ github.event.repository.name }}.zip |