Skip to content

Commit

Permalink
Add CI/CD on gh actions and remove travis ci
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentC35 committed Mar 31, 2021
1 parent 2facfb4 commit 5df1054
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 36 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build

on:
pull_request:
branches:
- '*'

jobs:
install:
runs-on: ubuntu-latest
steps:
- name: Use Node.js 14C
uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn --frozen-lockfile
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn
- run: yarn build
- name: Upload build
uses: actions/upload-artifact@v2
with:
name: build
path: build
55 changes: 55 additions & 0 deletions .github/workflows/develop-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release Candidate

on:
push:
branches:
- 'develop'
tags:
- '*'

jobs:
install:
runs-on: ubuntu-latest
steps:
- name: Use Node.js 14C
uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn --frozen-lockfile
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn
- run: yarn build
- name: Upload build
uses: actions/upload-artifact@v2
with:
name: build
path: build
release:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@v2
- name: Get current version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: 'package.json'
prop_path: 'version'
- run: echo ${{steps.version.outputs.prop}}
- name: Release snapshot
id: release-snapshot
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{steps.version.outputs.prop}}-rc
release_name: Release Candidate ${{steps.version.outputs.prop}}
draft: false
prerelease: false
81 changes: 81 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Release & Docker

on:
push:
branches:
- 'master'
tags:
- '*'

jobs:
install:
runs-on: ubuntu-latest
steps:
- name: Use Node.js 14C
uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn --frozen-lockfile
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn
- run: yarn build
- name: Upload build
uses: actions/upload-artifact@v2
with:
name: build
path: build
release:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@v2
- name: Get current version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: 'package.json'
prop_path: 'version'
- run: echo ${{steps.version.outputs.prop}}
- name: Release snapshot
id: release-snapshot
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{steps.version.outputs.prop}}
release_name: ${{steps.version.outputs.prop}}
draft: false
prerelease: false
docker:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download build
id: download
uses: actions/download-artifact@v2
with:
name: build
path: build
- name: Get current version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: 'package.json'
prop_path: 'version'
- run: echo ${{steps.version.outputs.prop}}
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: inseefr/pearl-jam
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
tags: ${{steps.version.outputs.prop}}

35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/InseeFr/Pearl-Jam.svg?branch=master)](https://travis-ci.org/InseeFr/Pearl-Jam)
![Build](https://github.com/InseeFr/Pearl-Jam/actions/workflows/release.yml/badge.svg)

# Pearl Jam

Expand Down

0 comments on commit 5df1054

Please sign in to comment.