From c34cc2f89e86ca2975cd5f67484f9bbb4a23bd9f Mon Sep 17 00:00:00 2001 From: Luis Rodriguez Date: Fri, 20 Sep 2024 10:54:52 -0500 Subject: [PATCH] add gh actions --- .github/workflows/publish.yml | 27 +++++++++++++++++++++++++++ .github/workflows/verify.yml | 22 ++++++++++++++++++++++ package.json | 1 + 3 files changed, 50 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/verify.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..77e8873 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,27 @@ +name: publish +on: + push: + branches: + - master + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js/18 + uses: actions/setup-node@v4 + with: + node-version: 18 + - name: install dependencies + run: npm i + - name: prettier + run: npm run prettier + - name: build + run: npm run build + - name: verify + run: npm run verify + + - uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 0000000..767afcd --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,22 @@ +name: verify +on: + - pull_request + - push + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js/18 + uses: actions/setup-node@v4 + with: + node-version: 18 + - name: install dependencies + run: npm i + - name: prettier + run: npm run prettier + - name: build + run: npm run build + - name: verify + run: npm run verify diff --git a/package.json b/package.json index 8a204c5..53b64b3 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "dist" ], "scripts": { + "prettier": "prettier --check ./", "build": "strapi-plugin build", "test:ts:back": "run -T tsc -p server/tsconfig.json", "test:ts:front": "run -T tsc -p admin/tsconfig.json",