diff options
| author | Miquel Sabaté Solà <msabate@suse.com> | 2021-07-06 08:22:54 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <msabate@suse.com> | 2021-07-06 08:22:54 +0200 |
| commit | 65b14a348fa0b057c3641e1fc89c8503b746507b (patch) | |
| tree | a38ba5fadf3e412f3a03f3413753ac51d35dd57f /.github | |
| parent | 4e69d9c1ad7df3653c94bf2da0e8634563261e53 (diff) | |
| download | jo.mssola.com-65b14a348fa0b057c3641e1fc89c8503b746507b.tar.gz jo.mssola.com-65b14a348fa0b057c3641e1fc89c8503b746507b.zip | |
Added workflow
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to '.github')
| -rw-r--r-- | .github/ISSUE_TEMPLATE/custom.md | 21 | ||||
| -rw-r--r-- | .github/PULL_REQUEST_TEMPLATE.md | 10 | ||||
| -rw-r--r-- | .github/workflows/ci.yml | 69 |
3 files changed, 100 insertions, 0 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" |
