Skip to content

Commit 0160713

Browse files
committed
[patch] fix gha for pushing to stage
1 parent fa7fed4 commit 0160713

File tree

6 files changed

+78
-244
lines changed

6 files changed

+78
-244
lines changed

.github/workflows/build-push.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Deploy Staging
2+
on: push
3+
4+
env:
5+
NODE_VERSION: 18
6+
JAVA_VERSION: 11
7+
JAVA_DISTRIBUTION: 'adopt'
8+
9+
jobs:
10+
build-push:
11+
name: run tests, build and push
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install Node ${{ env.NODE_VERSION }}
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: ${{ env.NODE_VERSION }}
20+
cache: 'npm'
21+
22+
- name: Set up JDK 11
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: ${{ env.JAVA_VERSION }}
26+
distribution: ${{ env.JAVA_DISTRIBUTION }}
27+
28+
- name: Install dependencies
29+
run: npm run ci
30+
31+
- name: Lint tests
32+
run: npm run lint
33+
34+
- name: Run tests
35+
run: npm run test-report
36+
37+
- name: Test Report
38+
uses: dorny/test-reporter@v1
39+
if: always()
40+
with:
41+
name: Unit Tests
42+
fail-on-error: true,
43+
path: test-results.json # Path to test results
44+
reporter: mocha-json # Format of test results
45+
46+
- name: Publish Test Results
47+
uses: EnricoMi/publish-unit-test-result-action@v2
48+
id: test-results
49+
if: always()
50+
with:
51+
files: "test-results.json"
52+
53+
- name: Run coverage
54+
run: npm run cover
55+
56+
- name: upload codecov
57+
uses: codecov/codecov-action@v4
58+
59+
- name: Check whether we will be able to make the release
60+
run: bash ${GITHUB_WORKSPACE}/deployment/build-test.sh
61+
62+
- name: AWS, credentials setup
63+
# if: ${{ github.ref == 'refs/heads/master' }}
64+
uses: aws-actions/configure-aws-credentials@v4
65+
with:
66+
aws-region: us-west-1
67+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
68+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
69+
70+
- name: Deploy updated builds to staging
71+
# if: ${{ github.ref == 'refs/heads/master' }}
72+
id: build
73+
run: |
74+
./deployment/deploy-qa.sh

.github/workflows/deploy-qa.yml

Lines changed: 0 additions & 93 deletions
This file was deleted.

.github/workflows/gate-keep.yml

Lines changed: 0 additions & 94 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

deployment/deploy-qa.sh

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ NC='\033[0m'
2424

2525
echo -en "${GREEN}Pushing to CDN ...${NC}\n"
2626
aws s3 cp --content-type="text/javascript" --content-encoding="gzip" dist/build.min.js.gz s3://branch-cdn/branch-staging-latest.min.js --cache-control "max-age=300"
27-
aws s3 cp dist/example.html s3://branch-cdn/example-staging.html
27+
aws s3 cp example.html s3://branch-cdn/example-staging.html
2828

2929
echo -en "Invalidating cloudfront distribution for staging ...\n"
3030
aws configure set preview.cloudfront true
3131
aws cloudfront create-invalidation --distribution-id E10P37NG0GMER --paths /branch-staging-latest.min.js /example-staging
32+
3233
# Exit prompts
3334
echo -en "${GREEN}Done deploy QA script ...${NC}\n"

dev.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"APIEndpoint": "https://api2.branch.io",
3-
"sdkKey": null,
2+
"APIEndpoint": "https://api.stage.branch.io",
3+
"sdkKey": "key_live_feebgAAhbH9Tv85H5wLQhpdaefiZv5Dv",
44
"port": "3000"
55
}

0 commit comments

Comments
 (0)