Skip to content

Commit

Permalink
[patch] fix gha for pushing to stage
Browse files Browse the repository at this point in the history
  • Loading branch information
bredmond5 committed Nov 5, 2024
1 parent fa7fed4 commit c515d6f
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 99 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy Staging
on: push

env:
NODE_VERSION: 18
JAVA_VERSION: 11
JAVA_DISTRIBUTION: 'adopt'

jobs:
build-push:
name: run tests, build and push
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4

- name: Install Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Install dependencies
run: npm run ci

- name: Lint tests
run: npm run lint

- name: Run tests
id: runTests
run: npm run test

- name: Run coverage
id: runCover
if: steps.runTests.outcome == 'success'
run: npm run cover

- name: upload codecov
uses: codecov/codecov-action@v4
if: steps.runCover.outcome == 'success'

- name: Call the Build bash script for QA
# if: ${{ github.ref == 'refs/heads/master' }}
id: build
run: |
./deployment/deploy-qa.sh
93 changes: 0 additions & 93 deletions .github/workflows/deploy-qa.yml

This file was deleted.

1 change: 1 addition & 0 deletions deployment/deploy-qa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ NC='\033[0m'
echo -en "Invalidating cloudfront distribution for staging ...\n"
aws configure set preview.cloudfront true
aws cloudfront create-invalidation --distribution-id E10P37NG0GMER --paths /branch-staging-latest.min.js /example-staging

# Exit prompts
echo -en "${GREEN}Done deploy QA script ...${NC}\n"
4 changes: 2 additions & 2 deletions dev.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"APIEndpoint": "https://api2.branch.io",
"sdkKey": null,
"APIEndpoint": "https://api.stage.branch.io",
"sdkKey": "key_live_feebgAAhbH9Tv85H5wLQhpdaefiZv5Dv",
"port": "3000"
}
11 changes: 7 additions & 4 deletions example.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta content="http://branch.io/img/logo_icon_black.png" property="og:image" />
<meta content="Branch Metrics Web SDK Example App" property="og:title" />
<meta content="A basic example to demonstrate some of the ways that the Web SDK can be used" property="og:description" />
<meta content='key_place_holder' name='branch_key'/>
<meta content='your_key_here' name='branch_key'/>
<title>Branch Metrics Web SDK Example App</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<style type="text/css">
Expand Down Expand Up @@ -82,7 +82,9 @@ <h4>QR Code</h4>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script type="text/javascript">
(function(b,r,a,n,c,h,_,s,d,k){if(!b[n]||!b[n]._q){for(;s<_.length;)c(h,_[s++]);d=r.createElement(a);d.async=1;d.src="SCRIPT_URL_HERE";k=r.getElementsByTagName(a)[0];k.parentNode.insertBefore(d,k);b[n]=h}})(window,document,"script","branch",function(b,r){b[r]=function(){b._q.push([r,arguments])}},{_q:[],_v:1},"addListener banner closeBanner closeJourney data deepview deepviewCta first init link logout removeListener setBranchViewData setIdentity track trackCommerceEvent logEvent disableTracking getBrowserFingerprintId crossPlatformIds lastAttributedTouchData setAPIResponseCallback qrCode setRequestMetaData setDMAParamsForEEA setAPIUrl getAPIUrl".split(" "), 0);
(function(b,r,a,n,c,h,_,s,d,k){if(!b[n]||!b[n]._q){for(;s<_.length;)c(h,_[s++]);d=r.createElement(a);d.async=1;d.src="dev/build.js";k=r.getElementsByTagName(a)[0];k.parentNode.insertBefore(d,k);b[n]=h}})(window,document,"script","branch",function(b,r){b[r]=function(){b._q.push([r,arguments])}},{_q:[],_v:1},"addListener banner closeBanner closeJourney data deepview deepviewCta first init link logout removeListener setBranchViewData setIdentity track trackCommerceEvent logEvent disableTracking getBrowserFingerprintId crossPlatformIds lastAttributedTouchData setAPIResponseCallback qrCode setRequestMetaData setDMAParamsForEEA setAPIUrl getAPIUrl".split(" "), 0);

// branch.setAPIUrl("https://api.stage.branch.io")

branch.setAPIResponseCallback(function(url, method, requestBody, error, status, responseBody) {
console.log('Request: ' + method + ' ' + url + ' body=' + JSON.stringify(requestBody));
Expand Down Expand Up @@ -248,8 +250,9 @@ <h4>QR Code</h4>
"code_color":"#000000",
"background_color": "#FFFFFF",
"margin": 5,
"width": 1000,
"image_format": "png"
"width": 2000,
"image_format": "png",
"center_logo_url": "https://cdn.branch.io/branch-assets/1570220119072-og_image.png",
};
var qrCodeParams = {
tags: [ 'tag1', 'tag2' ],
Expand Down

0 comments on commit c515d6f

Please sign in to comment.