Temporary removal of sonar-scanner #180
Workflow file for this run
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: Miew CI/CD | |
on: [push, pull_request] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
node_modules | |
~/.sonar/cache | |
~/.yarn | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Setup Code Climate test-reporter | |
run: | | |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > /tmp/cc-test-reporter | |
chmod +x /tmp/cc-test-reporter | |
- name: Install dependencies and run CI script | |
run: | | |
yarn install | |
yarn run ci | |
deploy: | |
needs: build-and-test | |
runs-on: ubuntu-latest | |
steps: | |
- name: NPM Deployment | |
if: startsWith(github.ref, 'refs/tags/v') && matrix.node == 18 | |
run: | | |
# Ensure you set up the NPM_AUTH_TOKEN secret in your GitHub repository | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc | |
npm publish --tag latest |