From a4f5d208c5b15ab6dcb8704761b1492278c7ac8a Mon Sep 17 00:00:00 2001 From: Nectariferous Date: Tue, 9 Jul 2024 03:58:46 +0600 Subject: [PATCH] Create ci.yml --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6e9ea3f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14, 16] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + run: npm install + + - name: Lint code + run: npm run lint + + - name: Run tests + run: npm test + + - name: Build project + run: npm run build + + - name: Publish package + if: github.ref == 'refs/heads/main' + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}