Skip to content

test

test #57

name: SalesforceCommerceCloud/pwa-kit/deploy_latest_release
on:
# For testing - to be removed
push:
branches:
- 'deploy-demo-env-on-release'
# Run this workflow when a new Github release is published
release:
types: [released]
jobs:
check-latest-release:
runs-on: ubuntu-latest
outputs:
IS_LATEST_RELEASE: ${{ steps.checkRelease.outputs.IS_LATEST_RELEASE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check if latest release
uses: ./.github/actions/check_if_latest_release
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update Github Outputs
id: checkRelease
run: |-
IS_LATEST_RELEASE=$(echo ${{ env.IS_LATEST_RELEASE }})
if [ $IS_LATEST_RELEASE != "true" ]; then
echo "Deploy is not for the latest release. Stopping deployment"
fi
echo "IS_LATEST_RELEASE=$IS_LATEST_RELEASE" >> "$GITHUB_OUTPUT"
deploy-bug-bounty:
needs: check-latest-release
runs-on: ubuntu-latest
if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true'
env:
BUNDLE_NAME: "${{ github.event.release.tag_name }} && 'tag ${{ github.event.release.tag_name }}' || 'build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})' "
steps:
- name: Print bundle name
run: |-
echo $BUNDLE_NAME
# - name: Checkout
# uses: actions/checkout@v4
# - name: Setup node
# id: setup_node
# uses: actions/setup-node@v4
# with:
# node-version: 22
# cache: "npm"
# - name: Install Monorepo Dependencies
# run: |-
# # Install node dependencies
# node ./scripts/gtime.js monorepo_install npm ci
# - name: Generate Retail App Demo
# uses: ./.github/actions/e2e_generate_app
# with:
# PROJECT_KEY: "retail-react-app-bug-bounty"
# - name: Create MRT credentials file
# uses: "./.github/actions/create_mrt"
# with:
# mobify_user: ${{ secrets.MOBIFY_STG_CLIENT_USER }}
# mobify_api_key: ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }}
# - name: Push Bundle to MRT (Bug Bounty)
# uses: "./.github/actions/push_to_mrt"
# with:
# CWD: "../generated-projects/retail-react-app-bug-bounty"
# TARGET: testing
# PROJECT: pwa-kit
# MESSAGE: $BUNDLE_NAME
# FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait
deploy-demo-site:
needs: check-latest-release
runs-on: ubuntu-latest
if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true'
env:
BUNDLE_NAME: "${{ $github.event.release.tag_name && 'tag $github.event.release.tag_name ' || 'build $github.run_id on github.ref ( github.sha )'}} "

Check failure on line 85 in .github/workflows/deploy_latest_release.yml

View workflow run for this annotation

GitHub Actions / SalesforceCommerceCloud/pwa-kit/deploy_latest_release

Invalid workflow file

The workflow is not valid. .github/workflows/deploy_latest_release.yml (Line: 85, Col: 20): Unexpected symbol: '$github'. Located at position 1 within expression: $github.event.release.tag_name && 'tag $github.event.release.tag_name ' || 'build $github.run_id on github.ref ( github.sha )'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
id: setup_node
uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
- name: Install Monorepo Dependencies
run: |-
# Install node dependencies
node ./scripts/gtime.js monorepo_install npm ci
- name: Generate Retail App Demo
uses: ./.github/actions/e2e_generate_app
with:
PROJECT_KEY: "retail-react-app-demo-site"
- 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 }}
- name: Push Bundle to MRT (Demo Site)
uses: "./.github/actions/push_to_mrt"
with:
CWD: "../generated-projects/retail-react-app-demo-site"
TARGET: staging
PROJECT: scaffold-pwa
MESSAGE: $BUNDLE_NAME
FLAGS: --wait