Skip to content

Commit 6471df4

Browse files
committed
New workflow for bug bounty deploy
1 parent bfd292d commit 6471df4

File tree

4 files changed

+53
-4
lines changed

4 files changed

+53
-4
lines changed

.github/actions/push_to_mrt/action.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ inputs:
44
description: Project directory
55
default: ${{ github.workspace }}
66
TARGET:
7-
description: MRT target
7+
description: MRT target environment
88
FLAGS:
99
description: Push flags
10+
PROJECT:
11+
description: MRT target project
12+
default: "scaffold-pwa"
1013
runs:
1114
using: composite
1215
steps:
1316
- name: Push Bundle to MRT
1417
run: |-
1518
cd ${{ inputs.CWD }}
16-
project="scaffold-pwa"
1719
build="build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})"
1820
if [[ ${{ inputs.TARGET }} ]]; then
19-
npm run push -- -s $project --message "$build" --target ${{ inputs.TARGET }} ${{ inputs.FLAGS }}
21+
npm run push -- -s ${{ inputs.PROJECT }} --message "$build" --target ${{ inputs.TARGET }} ${{ inputs.FLAGS }}
2022
fi
2123
shell: bash

.github/workflows/bug_bounty.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: SalesforceCommerceCloud/pwa-kit/bug_bounty
2+
on:
3+
push:
4+
branches:
5+
- 'release-*'
6+
- 'mrt-test-ci-deploy'
7+
8+
jobs:
9+
deploy-bug-bounty:
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Node
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: ${{ matrix.node }}
18+
cache: npm
19+
20+
- name: Update NPM version
21+
if: env.IS_DEFAULT_NPM == 'false'
22+
run: |-
23+
npm install -g npm@${{ matrix.npm }}
24+
25+
- name: Generate Retail App Demo
26+
uses: ./.github/actions/e2e_generate_app
27+
with:
28+
PROJECT_KEY: "retail-react-app-bug-bounty"
29+
30+
- name: Create MRT credentials file
31+
if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && ( env.DEVELOP == 'true' || env.RELEASE == 'true' )
32+
uses: "./.github/actions/create_mrt"
33+
with:
34+
mobify_user: ${{ secrets.MOBIFY_STG_CLIENT_USER }}
35+
mobify_api_key: ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }}
36+
37+
- name: Push Bundle to MRT (Bug Bounty)
38+
if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && env.DEVELOP == 'true'
39+
uses: "./.github/actions/push_to_mrt"
40+
with:
41+
CWD: "../generated-projects/retail-react-app-bug-bounty"
42+
TARGET: testing
43+
PROJECT: pwa-kit
44+
FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com --wait

e2e/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,11 @@ module.exports = {
101101
},
102102
],
103103
"retail-app-private-client": [],
104+
"retail-react-app-bug-bounty": [],
104105
},
105106
PRESET: {
106107
"retail-app-private-client": "retail-react-app-private-slas-client",
108+
"retail-react-app-bug-bounty": "retail-react-app-bug-bounty",
107109
},
108110
EXPECTED_GENERATED_ARTIFACTS: {
109111
"retail-app-demo": [

e2e/scripts/generate-project.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ program
6262
'retail-app-demo',
6363
'retail-app-ext',
6464
'retail-app-no-ext',
65-
'retail-app-private-client'
65+
'retail-app-private-client',
66+
'retail-react-app-bug-bounty'
6667
]
6768
if (!validKeys.includes(value)) {
6869
throw new Error('Invalid project key.')

0 commit comments

Comments
 (0)