Skip to content

Commit

Permalink
Switch CI/CD to GitHub actions instead of Travis
Browse files Browse the repository at this point in the history
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
  • Loading branch information
bhufmann committed Dec 15, 2020
1 parent 5ff3923 commit df91952
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 28 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI-CD

on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:


jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04]
node: [12]

steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Build
shell: bash
run: |
yarn
env:
NODE_OPTIONS: "--max_old_space_size=4096"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9

publish:
needs: build
if: github.ref == 'refs/heads/master' && github.event_name == 'push' && github.repository == 'theia-ide/timeline-chart'

runs-on: ubuntu-latest

strategy:
matrix:
node: [12]

steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org'

- name: Pre-Publish
shell: bash
run: |
yarn
env:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9

- name: Publish
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
retry_wait_seconds: 60
max_attempts: 3
retry_on: error
command: yarn run publish:next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # The variable name comes from here: https://github.com/actions/setup-node/blob/70b9252472eee7495c93bb1588261539c3c2b98d/src/authutil.ts#L48
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

0 comments on commit df91952

Please sign in to comment.