From 65b14a348fa0b057c3641e1fc89c8503b746507b Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 6 Jul 2021 08:22:54 +0200 Subject: Added workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- .github/ISSUE_TEMPLATE/custom.md | 21 ++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 10 ++++++ .github/workflows/ci.yml | 69 ++++++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 37 +++++++++++++++++++++ README.md | 36 ++++----------------- 5 files changed, 143 insertions(+), 30 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/custom.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/ci.yml create mode 100644 CONTRIBUTING.md 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 +

+ Build Status for main branch + License GPL 3 +

-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 -- cgit v1.2.3