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
0 commit comments