Skip to content

Rename script for clarity #8

Rename script for clarity

Rename script for clarity #8

name: SalesforceCommerceCloud/pwa-kit/performance-metrics

Check failure on line 1 in .github/workflows/performance-metrics.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/performance-metrics.yml

Invalid workflow file

(Line: 5, Col: 14): Unexpected value ''
on:
workflow_dispatch: # Allows you to manually run the workflow on any branch.
schedule:
# Run every day at 12am (PST) - cron uses UTC times.
# Runs on the default branch.
# - cron: '0 8 * * *'
jobs:
run-performance-metrics:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install Monorepo Dependencies
run: |-
npm ci
- name: Get Template Version
run: |-
version=`jq -r ".version" packages/template-retail-react-app/package.json`
echo "retail_app_template_version=$version" >> "$GITHUB_ENV"
# TODO: use the other generate_app action that has more flexibility
# - name: Generate Retail App Private Client
# uses: ./.github/actions/e2e_generate_app
# with:
# PROJECT_KEY: 'retail-app-private-client'
# TEMPLATE_VERSION: ${{ env.retail_app_template_version }}
- name: Generate Retail App Private Client
uses: ./.github/actions/generate_app
with:
use_extensibility: false
is_private_client: true
setup_hybrid: false
project_dir: 'storefront'
project_id: 'storefront'
org_id: 'f_ecom_tbbn_prd'
short_code: 'performance-001'
client_id: '9629ef22-f8b8-4987-90ac-b815be3940c8'
site_id: 'SiteNemesis'
instance_url: 'https://zzrf-001.dx.commercecloud.salesforce.com' # this doesn't matter because the OCAPI proxy in Runtime Admin will take precedence
# TODO: is this step still needed? I think it expects a project key
# - name: Validate Generated Retail App Private Client
# uses: ./.github/actions/e2e_validate_generated_app
# with:
# PROJECT_KEY: 'retail-app-private-client'
# TEMPLATE_VERSION: ${{ env.retail_app_template_version }}
- name: Create MRT credentials file
uses: './.github/actions/create_mrt'
with:
mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }}
mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }}
# TODO: how did Rob run his push command?
- name: Push Bundle to MRT
uses: './.github/actions/push_to_mrt'
with:
CWD: '../generated-projects/retail-app-private-client'
TARGET: e2e-pwa-kit-private
FLAGS: --wait
# TODO: Remove this if not needed or change this to whatever storefront is used for performance metrics.
# - name: Set Retail App Private Client Home
# run: export RETAIL_APP_HOME=https://scaffold-pwa-e2e-pwa-kit-private.mobify-storefront.com/
# TODO: This step is not needed. We don't need to worry about calling it from the workflow. What we need to worry about is the build and deploy to MRT.
# - name: Run Performance Metrics
# run: npm run test:performance-metrics # TODO: Replace with whatever command is used for performance metrics.
# Optionally send Slack notifications for performance metrics.
# notify-slack-performance-metrics:
# needs: [run-performance-metrics] # Makes sure the performance metrics job has completed before running this job.
# if: ${{ always() }} # Runs this job even if the performance metrics job fails.
# runs-on: ubuntu-latest
# steps:
# - name: Send GitHub Action data to Slack workflow (Generated)
# id: slack-success
# if: ${{ github.event_name == 'schedule' && needs.run-performance-metrics.result == 'success' }}
# uses: slackapi/slack-github-action@v1.23.0
# with:
# payload: |
# {
# "message": "✅ All PWA Kit Private Client Performance Metrics tests passed!"
# }
# env:
# # TODO: Create a new slack webhook from the performance metrics slack channel.
# # Add the webhook url to the repository secrets with as SLACK_PERFORMANCE_METRICS_WEBHOOK_URL key.
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PERFORMANCE_METRICS_WEBHOOK_URL }}