From d9858558cb0858c3764a74b979bd4224f7719f67 Mon Sep 17 00:00:00 2001 From: Minghe Date: Wed, 27 Jul 2022 21:59:18 +0800 Subject: [PATCH] feat(publish): automatically publish to npm registry when codes merged to production branch --- .github/workflows/publish.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..5a90ac8d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,19 @@ +name: publish +on: + push: + branches: [production] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - run: yarn + - run: yarn build + - run: yarn test + - uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }}