-
Notifications
You must be signed in to change notification settings - Fork 212
112 lines (97 loc) · 3.43 KB
/
deploy_latest_release.yml
File metadata and controls
112 lines (97 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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 }})
echo "IS_LATEST_RELEASE=${{ env.IS_LATEST_RELEASE }}" >> "$GITHUB_OUTPUT"
if [ $IS_LATEST_RELEASE != "true" ]; then
echo "Deploy is not for the latest release. Stopping deployment"
fi
deploy-bug-bounty:
needs: check-latest-release
runs-on: ubuntu-latest
if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true'
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-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: "tag ${{ github.event.release.tag_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'
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: production
PROJECT: scaffold-pwa
MESSAGE: "tag ${{ github.event.release.tag_name }}"
FLAGS: --wait