Merge pull request #31 from sergiogc9/dependabot/npm_and_yarn/word-wr… #139
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
# This is a basic workflow to help you get started with Actions | |
name: Github Pipeline | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "pipeline" | |
pipeline: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.13.1] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Fetch tags | |
run: git fetch --tags | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: 'https://npm.pkg.github.com' | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
${{ steps.yarn-cache-dir-path.outputs.dir }} | |
**/node_modules | |
key: ${{ runner.os }}-yarn-modules-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn-modules- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: yarn install --ignore-scripts --frozen-lockfile | |
- name: Build | |
run: yarn build | |
- name: Quality code check | |
run: yarn prettier:check && yarn lint && yarn typescript:check | |
- name: Publish to Github | |
if: contains(github.ref, 'master') | |
run: yarn run publish --yes --no-verify-access | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up node for NPM | |
uses: actions/setup-node@v2 | |
with: | |
registry-url: 'https://registry.npmjs.org' | |
scope: '@sergiogc9' | |
- name: Publish to NPM | |
if: contains(github.ref, 'master') | |
run: yarn run publish --yes --no-verify-access --ignore-scripts | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |