v0.7.1 #87
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: CI | |
on: | |
push: | |
branches: [ main ] | |
release: | |
types: [ published ] | |
jobs: | |
testandbuild: | |
name: Test and Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node LTS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- name: Cache Yarn | |
uses: actions/cache@v4 | |
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn install | |
- name: Lint | |
run: yarn run ng lint | |
- name: Run Tests | |
run: yarn run ng test --watch=false --browsers=ChromeHeadlessCustom | |
- name: Build | |
if: github.event_name == 'release' && github.event.action == 'published' | |
run: yarn run ng build --configuration production | |
- name: Archive build | |
if: github.event_name == 'release' && github.event.action == 'published' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: deploy_dist | |
path: dist | |
deploy: | |
needs: testandbuild | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- name: Use Node LTS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Download build | |
uses: actions/download-artifact@v4 | |
with: | |
name: deploy_dist | |
path: . | |
- name: Set version | |
env: | |
RELEASE_VERSION: ${{ github.event.release.tag_name }} | |
run: npm version --git-tag-version=false $RELEASE_VERSION | |
- name: Publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npm publish --access public |