Merge pull request #663 from ieeemysight4rehab/dependabot/npm_and_yar… #380
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: Build and Deploy | |
on: | |
push: | |
branches: | |
- staging | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Install 🔧 | |
run: | | |
sudo npm install -g @vue/cli | |
sudo npm install -g codecov | |
sudo npm install -g wait-on | |
npm ci | |
- name: Run Cypress 🚀 | |
uses: cypress-io/github-action@v2 | |
with: | |
browser: chrome | |
start: npm run serve | |
wait-on: 'http://localhost:8080' | |
record: true | |
env: | |
# pass the Dashboard record key as an environment variable | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
# pass GitHub token to allow accurately detecting a build vs a re-run build | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate CodeCov Code Coverage Report 🔧 | |
run: | | |
ls -la | |
sudo codecov --disable=gcov | |
- name: Run CodeCov 🚀 | |
uses: codecov/codecov-action@v1 | |
with: | |
fail_ci_if_error: false # optional (default = false) | |
verbose: true # optional (default = false) | |
- name: Run Code Climate 🚀 | |
uses: paambaati/[email protected] | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
with: | |
coverageCommand: npm run coverage | |
debug: true | |
- name: Run SonarCloud 🚀 | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: Build 🔧 | |
run: | | |
npm run build | |
- name: Copy index.html And Rename To 404.html Into dist folder 🔧 | |
run: | | |
sudo ls -la | |
cd dist | |
cp index.html 404.html | |
sudo ls -la | |
cd .. | |
- name: Deploy 🚀 | |
uses: JamesIves/[email protected] | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BASE_BRANCH: staging | |
BRANCH: master | |
FOLDER: dist |