ci: replace travis by github actions #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | |
cd ${GITHUB_WORKSPACE}/example | |
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 |