Integrate licensight into github actions #20
This file contains 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: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
environment: dev | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Install dependencies | |
run: npm install -g pnpm@8 && pnpm install --frozen-lockfile | |
- name: Build project | |
run: pnpm run build | |
- name: Deploy to S3 | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: 'ap-southeast-1' | |
run: | | |
npm install -g aws-cli | |
aws s3 sync dist/ s3://dev-tools-app --delete | |
- name: Licensight scan | |
run: | | |
curl -Lo $RUNNER_TEMP/licensight-scan -O https://licensight.s3.eu-central-1.amazonaws.com/latest/linux/licensight-scan | |
chmod +x $RUNNER_TEMP/licensight-scan | |
$RUNNER_TEMP/licensight-scan generate -a DEV-tools -d . -e https://licensight-dev.homologation.cloud/ -at lk2SuwSMlFNNstIKFOKsEl7l/M77hQw3 -b ${GITHUB_REF#refs/heads/} |