diff --git a/.github/workflows/build-website.yml b/.github/workflows/build.yml similarity index 60% rename from .github/workflows/build-website.yml rename to .github/workflows/build.yml index 2c7e7ed..3c8c21e 100644 --- a/.github/workflows/build-website.yml +++ b/.github/workflows/build.yml @@ -12,13 +12,13 @@ jobs: steps: - name: Checkout 🛎️ - uses: actions/checkout@master - + uses: actions/checkout@v3 + - name: Setup Node 🔧 uses: actions/setup-node@v3 with: node-version: '14' - + - name: Install and Build 🔧 run: | yarn install @@ -30,3 +30,16 @@ jobs: with: branch: gh-pages # The branch the action should deploy to. It should be any branch other than `main` folder: dist # The folder the action should deploy. + + - name: Publish ✨ + id: publish + if: github.ref == 'refs/heads/main' + uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} + check-version: true + + - name: Version update + if: steps.publish.outputs.type != 'none' + run: | + echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}"