Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate from TravisCI to GitHub Actions #702

Merged
merged 3 commits into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy
on:
push:
tags:
- '*'
eshanholtz marked this conversation as resolved.
Show resolved Hide resolved
workflow_dispatch:

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout twilio-node
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_AUTH_TOKEN }}

- name: Build and Push image
run: make docker-build && make docker-push

- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: 8
registry-url: 'https://registry.npmsjs.org'

- run: npm install
- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish

notify-on-failure:
name: Slack notify on failure
if: ${{ failure() }}
needs: [deploy]
runs-on: ubuntu-latest
steps:
- uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_ICON_EMOJI: ':github:'
SLACK_MESSAGE: ${{ format('Failed to deploy {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
SLACK_TITLE: Deployment Failure
SLACK_USERNAME: GitHub Actions
SLACK_MSG_AUTHOR: twilio-dx
SLACK_FOOTER: Posted automatically using GitHub Actions
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: true
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Tests
on:
push:
branches: [ '*' ]
pull_request:
branches: [ main ]
schedule:
# Run automatically at 8AM PST Monday-Friday
- cron: '0 15 * * 1-5'
workflow_dispatch:

jobs:
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
node: [6, 8, 10, lts/*]
steps:
- name: Checkout twilio-node
uses: actions/checkout@v2

- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- run: npm install
- name: Run Unit Tests
run: npm run ci

notify-on-failure:
name: Slack notify on failure
if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_ICON_EMOJI: ':github:'
SLACK_MESSAGE: ${{ format('Build {2} in {1} failed{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
SLACK_TITLE: Build Failure
SLACK_USERNAME: GitHub Actions
SLACK_MSG_AUTHOR: twilio-dx
SLACK_FOOTER: Posted automatically using GitHub Actions
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: true
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.