Skip to content

Commit

Permalink
👋 Bye travis, hello GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
flbulgarelli committed Nov 27, 2022
1 parent 32491b2 commit fb2cae1
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 25 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Test and deploy

on:
- push
- workflow_dispatch

jobs:
test_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
- name: Buikd package
run: npm run build
- name: Deploy
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create release
id: create_release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload package to release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/dist/headbreaker.js
asset_name: heabreaker.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

0 comments on commit fb2cae1

Please sign in to comment.