Document Development Container support #148
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 | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js 12 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '12' | |
- name: Cache node modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Before install | |
run: npm set //npm.pkg.github.com/:_authToken ${{secrets.TOKEN_FOR_WORKFLOWS}} | |
- name: Install dependencies | |
run: npm ci | |
- name: Unit tests | |
run: npm run test -- --watch=false --no-progress --browsers=ChromeHeadless --code-coverage | |
- name: Sonar Cloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{secrets.TOKEN_FOR_WORKFLOWS}} | |
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}} | |
- name: E2E tests | |
run: ./build-scripts/conditional-e2e.sh | |
shell: bash | |
- name: Build for deployment | |
run: npm run build -- --configuration=testdeployment --baseHref="https://sitmun.github.io/admin-app/" | |
- name: Deploy to GitHub pages | |
env: | |
USERNAME: ${{secrets.USERNAME_FOR_WORKFLOWS}} | |
GITHUB_API_KEY: ${{secrets.TOKEN_FOR_WORKFLOWS}} | |
run: ./build-scripts/deploy.sh | |
shell: bash |