@@ -31,10 +31,25 @@ jobs:
3131 fi
3232 echo "IS_LATEST_RELEASE=$IS_LATEST_RELEASE" >> "$GITHUB_OUTPUT"
3333
34- deploy-bug-bounty :
34+ deploy-sites :
3535 needs : check-latest-release
3636 runs-on : ubuntu-latest
37- if : needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true'
37+ if : needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true'
38+ strategy :
39+ matrix :
40+ environment :
41+ - name : bug-bounty
42+ project_key : retail-react-app-bug-bounty
43+ target : testing
44+ project : pwa-kit
45+ mobify_user : ${{ secrets.MOBIFY_STG_CLIENT_USER }}
46+ mobify_api_key : ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }}
47+ - name : demo-site
48+ project_key : retail-react-app-demo-site
49+ target : production
50+ project : scaffold-pwa
51+ mobify_user : ${{ secrets.MOBIFY_CLIENT_USER }}
52+ mobify_api_key : ${{ secrets.MOBIFY_CLIENT_API_KEY }}
3853 steps :
3954 - name : Checkout
4055 uses : actions/checkout@v4
@@ -54,64 +69,13 @@ jobs:
5469 - name : Generate Retail App Demo
5570 uses : ./.github/actions/e2e_generate_app
5671 with :
57- PROJECT_KEY : " retail-react-app-bug-bounty "
72+ PROJECT_KEY : ${{ matrix.environment.project_key }}
5873
5974 - name : Create MRT credentials file
6075 uses : " ./.github/actions/create_mrt"
6176 with :
62- mobify_user : ${{ secrets.MOBIFY_STG_CLIENT_USER }}
63- mobify_api_key : ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }}
64-
65- - name : Set bundle name
66- run : |-
67- TAG_NAME=$(echo ${{ github.event.release.tag_name }})
68- if [ "$TAG_NAME" ]; then
69- BUNDLE_NAME="tag ${{ github.event.release.tag_name }}"
70- else
71- BUNDLE_NAME="build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})"
72- fi
73- echo "Setting bundle name as $BUNDLE_NAME"
74- echo "BUNDLE_NAME=$BUNDLE_NAME" >> $GITHUB_ENV
75-
76- - name : Push Bundle to MRT (Bug Bounty)
77- uses : " ./.github/actions/push_to_mrt"
78- with :
79- CWD : " ../generated-projects/retail-react-app-bug-bounty"
80- TARGET : testing
81- PROJECT : pwa-kit
82- MESSAGE : ${{ env.BUNDLE_NAME }})
83- FLAGS : --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait
84-
85- deploy-demo-site :
86- needs : check-latest-release
87- runs-on : ubuntu-latest
88- if : needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true'
89- steps :
90- - name : Checkout
91- uses : actions/checkout@v4
92-
93- - name : Setup node
94- id : setup_node
95- uses : actions/setup-node@v4
96- with :
97- node-version : 22
98- cache : " npm"
99-
100- - name : Install Monorepo Dependencies
101- run : |-
102- # Install node dependencies
103- node ./scripts/gtime.js monorepo_install npm ci
104-
105- - name : Generate Retail App Demo
106- uses : ./.github/actions/e2e_generate_app
107- with :
108- PROJECT_KEY : " retail-react-app-demo-site"
109-
110- - name : Create MRT credentials file
111- uses : " ./.github/actions/create_mrt"
112- with :
113- mobify_user : ${{ secrets.MOBIFY_CLIENT_USER }}
114- mobify_api_key : ${{ secrets.MOBIFY_CLIENT_API_KEY }}
77+ mobify_user : ${{ matrix.environment.mobify_user }}
78+ mobify_api_key : ${{ matrix.environment.mobify_api_key }}
11579
11680 - name : Set bundle name
11781 run : |-
@@ -124,11 +88,11 @@ jobs:
12488 echo "Setting bundle name as $BUNDLE_NAME"
12589 echo "BUNDLE_NAME=$BUNDLE_NAME" >> $GITHUB_ENV
12690
127- - name : Push Bundle to MRT (Demo Site )
91+ - name : Push Bundle to MRT (${{matrix.environment.name}} )
12892 uses : " ./.github/actions/push_to_mrt"
12993 with :
130- CWD : " ../generated-projects/retail-react-app-demo-site "
131- TARGET : production
132- PROJECT : scaffold-pwa
94+ CWD : " ../generated-projects/${{ matrix.environment.project_key }} "
95+ TARGET : ${{ matrix.environment.target }}
96+ PROJECT : ${{ matrix.environment.project }}
13397 MESSAGE : ${{ env.BUNDLE_NAME }})
13498 FLAGS : --wait
0 commit comments