Skip to content

Commit b96c79a

Browse files
committed
Restore actual changes
1 parent a4a234d commit b96c79a

File tree

1 file changed

+40
-17
lines changed

1 file changed

+40
-17
lines changed

.github/workflows/bug_bounty.yml

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,62 @@
11
name: SalesforceCommerceCloud/pwa-kit/bug_bounty
22
on:
3+
# For testing - to be removed
34
push:
45
branches:
56
- 'mrt-test-ci-deploy'
7+
# Run this job when a new Github release is published
8+
release:
9+
types: [released]
610

711
jobs:
812
deploy-bug-bounty:
913
runs-on: ubuntu-latest
1014
steps:
1115
- name: Check if latest release
1216
id: release
13-
run: |
17+
run: |-
1418
RELEASE_JSON=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
1519
"https://api.github.com/repos/${{ github.repository }}/releases/latest")
1620
1721
LATEST_TAG_NAME=$(echo "$RELEASE_JSON" | jq -r '.tag_name')
1822
RELEASE_EVENT_TAG_NAME=$(echo ${{ github.event.release.tag_name }})
23+
24+
echo "Latest tag: $LATEST_TAG_NAME"
25+
echo "Release event tag: $RELEASE_EVENT_TAG_NAME"
26+
1927
if [ "$LATEST_TAG_NAME" == "$RELEASE_EVENT_TAG_NAME" ]; then
20-
echo "true"
28+
echo "We are releasing the latest. Continuing to deploy to bug bounty instance"
2129
echo "IS_LATEST_RELEASE=true" >> $GITHUB_ENV
22-
else
23-
echo "false"
24-
echo "IS_LATEST_RELEASE=false" >> $GITHUB_ENV
2530
fi
2631
27-
echo "Latest tag: $LATEST_TAG_NAME"
28-
echo "Release event tag: $RELEASE_EVENT_TAG_NAME"
29-
echo "Is latest release: ${{ env.IS_LATEST_RELEASE }}"
30-
31-
- name: Test env var true
32+
- name: Checkout
33+
if: env.IS_LATEST_RELEASE == 'true'
34+
uses: actions/checkout@v4
35+
36+
- name: Install Monorepo Dependencies
37+
if: env.IS_LATEST_RELEASE == 'true'
38+
run: |-
39+
# Install node dependencies
40+
node ./scripts/gtime.js monorepo_install npm ci
41+
42+
- name: Generate Retail App Demo
43+
if: env.IS_LATEST_RELEASE == 'true'
44+
uses: ./.github/actions/e2e_generate_app
45+
with:
46+
PROJECT_KEY: "retail-react-app-bug-bounty"
47+
48+
- name: Create MRT credentials file
49+
if: env.IS_LATEST_RELEASE == 'true'
50+
uses: "./.github/actions/create_mrt"
51+
with:
52+
mobify_user: ${{ secrets.MOBIFY_STG_CLIENT_USER }}
53+
mobify_api_key: ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }}
54+
55+
- name: Push Bundle to MRT (Bug Bounty)
3256
if: env.IS_LATEST_RELEASE == 'true'
33-
run: |
34-
echo "true"
35-
36-
- name: Test env var false
37-
if: env.IS_LATEST_RELEASE == 'false'
38-
run: |
39-
echo "false"
57+
uses: "./.github/actions/push_to_mrt"
58+
with:
59+
CWD: "../generated-projects/retail-react-app-bug-bounty"
60+
TARGET: testing
61+
PROJECT: pwa-kit
62+
FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait

0 commit comments

Comments
 (0)