From 8cfa49cd7a64b49f591cccda129af955ef8e62e2 Mon Sep 17 00:00:00 2001 From: EliuX Date: Tue, 10 Dec 2024 13:24:02 -0500 Subject: [PATCH] ci: replace travis by github actions --- .github/workflows/main.yml | 46 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 28 ----------------------- README.md | 2 +- 3 files changed, 47 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..d924810 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,46 @@ +name: Serverless Migrate Plugin CI + +on: + push: + branches: [ feature/update-readme-custom-migrate ] + pull_request: + branches: [ feature/update-readme-custom-migrate ] + release: + types: [published] +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies for CI + run: npm ci + + - name: Link package + run: | + cd ${GITHUB_WORKSPACE}/example + npm link serverless-migrate-plugin + + - name: Build and test + run: | + npm run create + npm run up + npm run down + npm run list + echo It is all good man! + cd - + + - name: Deploy to npm + run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + PACKAGE_NAME: serverless-migrate-plugin diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4cf527d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -dist: trusty -language: node_js -node_js: - - lts/* -before_install: - - npm install - - npm link - - cd ${TRAVIS_BUILD_DIR}/example - - npm install -g serverless - - npm link serverless-migrate-plugin - - npm install -install: - - echo "Running basic commands" - - npm run create - - npm run up - - npm run down - - npm run list - - echo It is all good man! -after_success: - - cd .. -deploy: - provider: npm - email: $NPM_USER - api_key: $NPM_TOKEN - edge: true - on: - tags: true - repo: EliuX/serverless-migrate-plugin diff --git a/README.md b/README.md index 88d0df2..07d8977 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Serverless plugin for migrate ============================== -[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com) +[![serverless](https://badges.serverless.com/v3.svg)](https://www.serverless.com) [![npm version](https://badge.fury.io/js/serverless-migrate-plugin.svg)](https://badge.fury.io/js/serverless-migrate-plugin) This is a plugin for the [Serverless][serverless-web] framework that allows you to manage and run database-agnostic