-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate from TravisCI to GitHub Actions (#702)
- Loading branch information
1 parent
7ce31ab
commit 9c4ee82
Showing
3 changed files
with
102 additions
and
45 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Deploy | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
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 |
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
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 |
This file was deleted.
Oops, something went wrong.