[other] use s3 usw2 #49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy QA | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| branch_name: | |
| description: 'Enter name of the branch' | |
| required: true | |
| default: 'main' | |
| pull_request: | |
| types: [closed] | |
| branches: | |
| - main | |
| paths-ignore: | |
| - docs/** | |
| - README.md | |
| env: | |
| BRANCH_NAME: '${{ github.event.inputs.branch_name || github.head_ref || github.ref_name }}' | |
| NODE_VERSION: 16 | |
| JAVA_VERSION: 11 | |
| JAVA_DISTRIBUTION: 'adopt' | |
| jobs: | |
| test-unit: | |
| name: Unit tests | |
| runs-on: arc-standard-small-set | |
| steps: | |
| - name: Checkout ${{ github.ref_name }} | |
| uses: actions/checkout@v3 | |
| - name: Setup .npmrc | |
| uses: bduff9/[email protected] | |
| with: | |
| dot-npmrc: ${{ secrets.DOT_NPMRC }} | |
| - name: Install Node ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Run tests | |
| id: runTests | |
| run: npm run test | |
| - name : upload codecov | |
| uses: codecov/codecov-action@v3 | |
| if: steps.runTests.outcome == 'success' | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| test-lint: | |
| name: Lint | |
| runs-on: arc-standard-small-set | |
| steps: | |
| - name: Checkout ${{ github.ref_name }} | |
| uses: actions/checkout@v3 | |
| - name: Setup .npmrc | |
| uses: bduff9/[email protected] | |
| with: | |
| dot-npmrc: ${{ secrets.DOT_NPMRC }} | |
| - name: Install Node ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Lint tests | |
| run: npm run lint | |
| deploy-qa: | |
| name: Deploy-QA | |
| needs: [test-unit,test-lint] | |
| if: ${{ github.ref_name == 'main' && github.event.pull_request.merged == true }} | |
| runs-on: arc-standard-small-set | |
| steps: | |
| - name: Checkout ${{ github.ref_name }} | |
| uses: actions/checkout@v3 | |
| - name: Install Node ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: ${{ env.JAVA_DISTRIBUTION }} | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Call the Build bash script for QA | |
| id: build | |
| run: bash ${GITHUB_WORKSPACE}/deployment/build-qa.sh | |
| - name: Sync S3 Builds | |
| id: s3syncbuilds | |
| if: steps.build.outcome == 'success' | |
| run: aws s3 sync ./dist s3://branch-builds-usw2/connected-sdk/ | |