aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/ISSUE_TEMPLATE/custom.md21
-rw-r--r--.github/PULL_REQUEST_TEMPLATE.md10
-rw-r--r--.github/workflows/ci.yml69
-rw-r--r--CONTRIBUTING.md37
-rw-r--r--README.md36
5 files changed, 143 insertions, 30 deletions
diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md
new file mode 100644
index 0000000..b931a07
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/custom.md
@@ -0,0 +1,21 @@
+---
+name: Custom issue template
+about: General issues, both bugs and features.
+title: ''
+labels: ''
+assignees: mssola
+---
+
+### Description
+
+Check out the [contribution guidelines](../CONTRIBUTING.md) file for some
+considerations before submitting a new issue.
+
+### Steps to reproduce
+
+1. First I did this...
+2. Then that...
+3. And this happened!
+
+- **Expected behavior**: I expected this to happen!
+- **Actual behavior**: But this happened...
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..1cae81f
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,10 @@
+Provide a general description of the changes in your pull request. If this pull request fixes a known issue, please tag it as well (e.g.: `Fixes #1`).
+
+Before submitting a PR make sure the following things have been done (and denote this by checking the relevant checkboxes):
+
+- [ ] The commits are consistent with the [contribution guidelines](../CONTRIBUTING.org).
+- [ ] `bundle exec rails test test/*` and `bundle exec rubocop` are passing.
+- [ ] You've updated the [changelog](../CHANGELOG.org) (if adding/changing user-visible functionality).
+- [ ] You've updated the [readme](../README.org) (if adding/changing user-visible functionality).
+
+Thanks for contributing to this project!
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..277577c
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,69 @@
+name: CI
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Set up Ruby
+ uses: ruby/setup-ruby@v1
+
+ - name: Get yarn cache directory path
+ id: yarn-cache-dir-path
+ run: echo "::set-output name=dir::$(yarn cache dir)"
+
+ - name: "Cache JS modules"
+ uses: actions/cache@v2
+ id: yarn-cache
+ with:
+ path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
+ key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-yarn-
+
+ - name: "Cache gems"
+ uses: actions/cache@v2
+ id: gem-cache
+ with:
+ path: vendor/bundle
+ key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-gems-
+
+ - name: "Install Ruby and Javascript dependencies"
+ env:
+ RAILS_ENV: "test"
+ NODE_ENV: "test"
+ run: |
+ bundle config set path 'vendor/bundle'
+ bundle install --jobs 4 --retry 3
+ yarn
+
+ - name: "Build site"
+ run: bundle exec jekyll build
+
+ - name: "Run rubocop"
+ run: bundle exec rubocop
+
+ - name: "Run tests"
+ run: bundle exec rake
+
+ - name: "Produce tarball"
+ run: tar czvf site.tar.gz _site
+
+ - name: "Upload tarball"
+ uses: appleboy/scp-action@master
+ with:
+ host: ${{ secrets.HOST }}
+ username: ${{ secrets.USERNAME }}
+ port: ${{ secrets.PORT }}
+ key: ${{ secrets.KEY }}
+ source: "site.tar.gz"
+ target: "test"
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..ea4b1c7
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,37 @@
+# Contributing
+
+In order to get started, you need to install [yarn](https://yarnpkg.com/),
+[git](https://git-scm.com/) (yeah, it's actually a dependency) and a proper ruby
+development environment (with bundler already installed). Then, you can simply
+fetch dependencies like so:
+
+```
+$ yarn
+$ bundle
+```
+
+After that, build Javascript files with:
+
+```
+$ yarn run webpack
+```
+
+And in another session start Jekyll with:
+
+```
+$ bundle exec jekyll serve
+```
+
+## Testing
+
+Before submitting a Pull Request, make sure that tests are passing. This can be
+checked by running:
+
+```
+$ bundle exec rubocop
+$ bundle exec rake
+```
+
+## Deploying
+
+This is already handled through a Github action, so don't worry about it.
diff --git a/README.md b/README.md
index ae7f83a..32dd250 100644
--- a/README.md
+++ b/README.md
@@ -1,35 +1,11 @@
-# jo
+<p align="center">
+ <a href="https://github.com/mssola/jo.mssola.com/actions?query=workflow%3ACI" title="CI status for the main branch"><img src="https://github.com/mssola/jo.mssola.com/workflows/CI/badge.svg" alt="Build Status for main branch" /></a>
+ <a href="http://www.gnu.org/licenses/agpl-3.0.txt" rel="nofollow"><img alt="License GPL 3" src="https://img.shields.io/badge/license-AGPL_3-blue.svg" style="max-width:100%;"></a>
+</p>
-Files for my personal website. In order to get started, you need to install
-[yarn](https://yarnpkg.com/), [git](https://git-scm.com/) (yeah, it's actually a
-dependency) and you need a proper ruby development environment (with bundler
-already installed). Then, you can simply fetch dependencies like so:
+---
-```
-$ yarn
-$ bundle
-```
-
-After that, build Javascript files with:
-
-```
-$ yarn run webpack
-```
-
-And in another session start Jekyll with:
-
-```
-$ bundle exec jekyll serve
-```
-
-If you just want to **deploy**, simply run:
-
-```
-$ ./script/build.sh
-```
-
-This will write everything into a `_site` directory. Use this directory to serve
-all files.
+My personal website.
## License