Skip to content

Integrate licensight into github actions #21

Integrate licensight into github actions

Integrate licensight into github actions #21

Workflow file for this run

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: Determine branch name
id: extract_branch
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "Branch name: ${{ github.head_ref }}"
echo "::set-output name=branch::${{ github.head_ref }}"
else
echo "Branch name: ${GITHUB_REF#refs/heads/}"
echo "::set-output name=branch::${GITHUB_REF#refs/heads/}"
fi
- 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 ${steps.extract_branch.outputs.branch}