Skip to content

Commit

Permalink
Added gh action for site building
Browse files Browse the repository at this point in the history
  • Loading branch information
Fmazin committed Jun 3, 2021
1 parent 39320fe commit f919dd9
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 101 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/site_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build site

on:
push:
branches:
- master
workflow_dispatch:

jobs:
deploy-site:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install node
uses: actions/setup-node@v1
with:
node-version: 14.16.0

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

# Action for collection of short branchname in commit mesage
- name: Inject short variables
uses: rlespinasse/[email protected]
- name: Nodes packages
run: |
npm install
- name: Debug script Mac and Linux
if: runner.os == 'Linux' || runner.os == 'macOS'
run: DEBUG=* npm run-script testci

- name: Debug script Windows
if: runner.os == 'Windows'
run: $DEBUG = 'npm', 'run-script', 'testci'

- name: Setup pip packages
run: |
pip install -r docs/requirements.txt
shopt -s expand_aliases
- name: Build the documentation
run: mkdocs build --clean --verbose

- name: Replace current build version and date
run: |
CURRENT_VERSION=$(git log --pretty=format:'%h' -n 1)
CURRENT_DATE=$(git show -s --format=%ci $CURRENT_VERSION)
echo $CURRENT_VERSION "@" $CURRENT_DATE
sed -i "s/@@VERSION@@/$CURRENT_VERSION/g" site/index.html
sed -i "s/@@TIMESTAMP@@/$CURRENT_DATE/g" site/index.html
- name: Deploy to Github pages
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: site # The folder the action should deploy.
commit-message: Rebuild pages at ${{github.sha}} with branch ${{ env.GITHUB_REF_SLUG }}
git-config-name: Build bot <[email protected]>
git-config-email: [email protected]
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.travis.yml
.vscode
etc
test
Expand Down
56 changes: 0 additions & 56 deletions .travis.yml

This file was deleted.

5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ npm test

## Contribute documentation

Documentation is build based on Markdown files in the `/docs` directory and rendered into static HTML pages with [mkdocs]() using Travis CI (see `.travis.yml`).
Documentation is build based on Markdown files in the `/docs` directory and rendered into static HTML pages with [mkdocs]() using a Github Action (see `.github/workflows/site_build.yml`).

**View docs locally** using Python 3:

Expand Down Expand Up @@ -80,8 +80,7 @@ mkdocs build --clean --verbose

## Online documentation

The online documentation is automatically built by Travis CI, see file `.travis.yml`.
For background on the personal access token see [https://github.com/o2r-project/erc-spec#automated-builds](https://github.com/o2r-project/erc-spec#automated-builds).
The online documentation is automatically built by a Github Action, see file `.github/workflows/site_build.yml`.

## Development hints

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# erc-checker

[![Build Status](https://travis-ci.org/o2r-project/erc-checker.svg?branch=master)](https://travis-ci.org/o2r-project/erc-checker) [![Build status](https://ci.appveyor.com/api/projects/status/xbla7j4wpbwauk7p/branch/master?svg=true)](https://ci.appveyor.com/project/nuest/erc-checker-r035a/branch/master) [![npm](https://img.shields.io/npm/v/erc-checker.svg)](https://www.npmjs.com/package/erc-checker) [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2203843.svg)](https://doi.org/10.5281/zenodo.2203843) [![SWH](https://archive.softwareheritage.org/badge/swh:1:dir:a67e6dcbe3a1b5b38aad94fea4095324cd09607a/)](https://archive.softwareheritage.org/swh:1:dir:a67e6dcbe3a1b5b38aad94fea4095324cd09607a;origin=https://github.com/o2r-project/erc-checker.git;visit=swh:1:snp:e3d5cd96bdcee333417ea2192584060bef2a77ac;anchor=swh:1:rev:41e32824d581e763c58004e498c1bf1f343ef6c7;path=//)
![badge for workflow status](https://github.com/o2r-project/erc-checker/actions/workflows/site_build.yml/badge.svg) [![Build status](https://ci.appveyor.com/api/projects/status/xbla7j4wpbwauk7p/branch/master?svg=true)](https://ci.appveyor.com/project/nuest/erc-checker-r035a/branch/master) [![npm](https://img.shields.io/npm/v/erc-checker.svg)](https://www.npmjs.com/package/erc-checker) [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2203843.svg)](https://doi.org/10.5281/zenodo.2203843) [![SWH](https://archive.softwareheritage.org/badge/swh:1:dir:a67e6dcbe3a1b5b38aad94fea4095324cd09607a/)](https://archive.softwareheritage.org/swh:1:dir:a67e6dcbe3a1b5b38aad94fea4095324cd09607a;origin=https://github.com/o2r-project/erc-checker.git;visit=swh:1:snp:e3d5cd96bdcee333417ea2192584060bef2a77ac;anchor=swh:1:rev:41e32824d581e763c58004e498c1bf1f343ef6c7;path=//)

A JavaScript library and CLI tool for [ERC](https://github.com/o2r-project/erc-spec) result checking.

Expand Down
1 change: 0 additions & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"@type": "SoftwareSourceCode",
"license": "https://spdx.org/licenses/Apache-2.0",
"codeRepository": "git+https://github.com/o2r-project/erc-checker.git",
"contIntegration": "https://travis-ci.org/o2r-project/erc-checker",
"dateCreated": "2019-08-16",
"datePublished": "2018-08-05",
"dateModified": "2020-04-24",
Expand Down
39 changes: 0 additions & 39 deletions docs/site_build.sh

This file was deleted.

0 comments on commit f919dd9

Please sign in to comment.