Skip to content

Commit

Permalink
chore(*): make automatic test deployments for each PR through CI (#483)
Browse files Browse the repository at this point in the history
and build compodoc through GitHub Actions instead of Travis

closes #411
  • Loading branch information
TheSlimvReal authored Aug 15, 2020
1 parent 230c6b0 commit 7138b98
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 16 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/deploy-compodoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Deploy Compodoc to GitHub Pages
on:
push:
branches:
- master

jobs:
create-and-deploy-compodoc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: npm install @compodoc/compodoc
- name: Run compodoc
run: npm run compodoc
- name: Deploy on pages
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: doc/compodoc
destination_dir: documentation

29 changes: 29 additions & 0 deletions .github/workflows/deploy-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy Aam-digital to GitHub Pages
on: pull_request

jobs:
deploy-website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: npm install
- name: Build deployment
run: npm run build -- --base-href=/ndb-core/deployments/${{ github.head_ref }}/
- name: Deploy on pages
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist/
destination_dir: deployments/${{ github.head_ref }}
- name: Post comment on PR
env:
PR: ${{ github.ref }}
run: |
PR=${PR#refs/*/}
PR=${PR%/*}
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/Aam-Digital/ndb-core/issues/$PR/comments \
-d '{"body":"Deployed to https://aam-digital.github.io/ndb-core/deployments/${{ github.head_ref }}"}'
27 changes: 27 additions & 0 deletions .github/workflows/remove_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Remove deployment from GitHub Pages
on:
pull_request:
types: [closed]

jobs:
remove-deployment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: gh-pages
token: ${{ secrets.GITHUB_TOKEN }}
- name: Remove directory
run: |
[ -d deployments/${{ github.head_ref }} ] && rm -rf deployments/${{ github.head_ref }}
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "Remove Deployment Workflow"
git commit -m "Removed deployment for branch $${GITHUB_REF##*/}" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true
branch: gh-pages
9 changes: 0 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ script:

after_script:
- ./cc-test-reporter after-build --debug --exit-code $TRAVIS_TEST_RESULT
after_success:
- npm run compodoc

deploy:
- provider: script
Expand All @@ -46,10 +44,3 @@ deploy:
script: npx semantic-release
on:
all_branches: true
- provider: pages
skip_cleanup: true
local_dir: doc/compodoc
github_token: $GH_REPO_TOKEN
on:
all_branches: true
condition: ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} =~ ^(master|compodoc)$
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ we welcome any contributions to make this project better!
-----

## Get started
To get started, please have a look at our [Developer Documentation](https://aam-digital.github.io/ndb-core/additional-documentation/overview.html).
To get started, please have a look at our [Developer Documentation](https://aam-digital.github.io/ndb-core/documentation/additional-documentation/overview.html).

1. Work through the [Tutorial](https://aam-digital.github.io/ndb-core/additional-documentation/tutorial.html).
1. Work through the [Tutorial](https://aam-digital.github.io/ndb-core/documentation/additional-documentation/tutorial.html).
* This walks you through the setup and basic understanding of the project and also gives an overview of the technologies and frameworks involved.
* Feel free to skip over steps that seem trivial to you, we tried to make this very beginner friendly.
2. Check our workflow regarding pull requests: [How to contribute code](https://aam-digital.github.io/ndb-core/additional-documentation/how-to-guides/contribute-code-to-the-project.html)
2. Check our workflow regarding pull requests: [How to contribute code](https://aam-digital.github.io/ndb-core/documentation/additional-documentation/how-to-guides/contribute-code-to-the-project.html)
3. Don't hesitate to ask questions!

## Get in touch
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
[![Build Status](https://travis-ci.org/Aam-Digital/ndb-core.svg?branch=master)](https://travis-ci.org/Aam-Digital/ndb-core)
[![Code Climate](https://codeclimate.com/github/Aam-Digital/ndb-core/badges/gpa.svg)](https://codeclimate.com/github/Aam-Digital/ndb-core)
[![Test Coverage](https://api.codeclimate.com/v1/badges/4e4a7a6301064019b2c9/test_coverage)](https://codeclimate.com/github/Aam-Digital/ndb-core/test_coverage)
[![Guides](https://img.shields.io/badge/Tutorial%20%26%20Guides-12-blue)](https://aam-digital.github.io/ndb-core/additional-documentation/overview.html)
[![Doc CoverageDocs](https://aam-digital.github.io/ndb-core/images/coverage-badge-documentation.svg)](https://aam-digital.github.io/ndb-core/modules.html)
[![Guides](https://img.shields.io/badge/Tutorial%20%26%20Guides-12-blue)](https://aam-digital.github.io/ndb-core/documentation/additional-documentation/overview.html)
[![Doc CoverageDocs](https://aam-digital.github.io/ndb-core/documentation/images/coverage-badge-documentation.svg)](https://aam-digital.github.io/ndb-core/documentation/modules.html)


# Aam Digital
Empowering NGOs' social workers with simple to use (database) software.

> For more information about the software and a free demo system visit **[www.aam-digital.com](https://www.aam-digital.com)**.
> For more information about the code including guides see the separate **[Developer Documentation](http://aam-digital.github.io/ndb-core/additional-documentation/overview.html)**
> For more information about the code including guides see the separate **[Developer Documentation](https://aam-digital.github.io/ndb-core/documentation/additional-documentation/overview.html)**
-----

Expand Down Expand Up @@ -73,7 +73,7 @@ _docker/nginx_default.conf_ (for production server):
5. `npm run start` to run your local dev server and get started.

## Documentation
Our detailed [Developer Documentation](http://aam-digital.github.io/ndb-core/additional-documentation/overview.html)
Our detailed [Developer Documentation](https://aam-digital.github.io/ndb-core/documentation/additional-documentation/overview.html)
provides tutorials, guides, concepts and an API reference.

## Code Style
Expand Down

0 comments on commit 7138b98

Please sign in to comment.