-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (58 loc) · 2.03 KB
/
upload.yml
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
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
name: Build and Upload Artifacts
on:
push:
branches:
- release
- master
- main
jobs:
build_and_upload:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Set global environment
run: echo "NPM_TOKEN=${{secrets.NPM_TOKEN}}" >> $GITHUB_ENV
- name: Install dependencies
run: yarn
- name: Clean
run: yarn clean
- name: Linting
run: yarn lint
- name: Run tests
run: yarn test
- name: Upload test coverage
uses: medlypharmacy/s3-artifacts-action@master
with:
aws_access_key_id: ${{ secrets.S3_BUILD_ARTIFACTS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.S3_BUILD_ARTIFACTS_SECRET_ACCESS_KEY }}
aws_s3_bucket_name: medly-dev-test-cases
source_path: ./coverage
resource_type: TEST_COVERAGE
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: SonarQube Quality Gate check
uses: sonarsource/sonarqube-quality-gate-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
timeout-minutes: 5
- name: Create bundle
run: yarn dist
- name: Zip bundle
if: ${{ github.ref == 'refs/heads/release' }}
run: zip -jr dist.zip dist/*
- name: Upload artifacts to the common S3 bucket for build artitacts of all apps
uses: medlypharmacy/s3-artifacts-action@master
if: ${{ github.ref == 'refs/heads/release' }}
with:
aws_access_key_id: ${{ secrets.S3_BUILD_ARTIFACTS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.S3_BUILD_ARTIFACTS_SECRET_ACCESS_KEY }}
source_path: "'./dist.zip'"