From 351c87a186b9f3a4f544d5620251bb18c2dbe5a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= Date: Tue, 6 Aug 2024 12:00:27 +0100 Subject: [PATCH] chore: new deploy script --- .github/workflows/deploy.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..588dedc --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,33 @@ +name: Deploy Workflow +on: + push: + tags: + - "*" +jobs: + build: + name: Deploy + timeout-minutes: 10 + strategy: + matrix: + node-version: [14] + runs-on: ubuntu-latest + container: node:${{ matrix.node-version }}-buster + steps: + - name: Checkout code from repository + uses: actions/checkout@v4 + - name: Print Node.js information + run: node --version + - name: Install package + run: npm install + - name: Install package (development) + run: npm install --only=dev + - name: Verify Javascript code linting + run: npm run lint + - name: Run unit tests + run: npm test + - name: Deploy package to NPM + run: | + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc + npm publish + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }}