Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pkoch committed Mar 20, 2024
1 parent 141e4e4 commit cbe7601
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"extends": [
"config:base"
],
"prConcurrentLimit": 5,
"baseBranches": ["master"],
"assignees": ["@strnadj"],
"schedule": [
"before 6am on the first week of the month"
],
"docker": {
"enabled": false
},
"docker-compose": {
"enabled": false
},
"circleci": {
"enabled": false
},
"vulnerabilityAlerts": {
"labels": ["dependencies", "security"],
"assignees": ["@strnadj", "@juliosantos", "@tiagofragoso"],
"schedule": "at any time"
},
"packageRules": [
{
"matchPackagePatterns": [
"*"
],
"matchUpdateTypes": [
"major",
"minor",
"patch"
],
"groupName": "all dependencies",
"groupSlug": "all-dependencies",
"labels": ["dependencies"]
}
]
}
25 changes: 25 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Create release

# When a tag is pushed, create a release
on:
push:
tags:
- "v*"

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
with:
fetch-depth: 0 # Fetch all tags

- name: Create Release for Tag
id: release_tag
uses: Akryum/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
67 changes: 67 additions & 0 deletions .github/workflows/review_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Review and deploy

on:
pull_request:
push:
branches:
- master

jobs:
target_name:
runs-on: ubuntu-latest

outputs:
name: ${{steps.branch_name.outputs.current_branch}}
cache_key: ${{steps.cache_key.outputs.key}}

steps:
- uses: actions/checkout@v4

- name: Get branch name
id: branch_name
uses: tj-actions/[email protected]

tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run test
run: |
bundle exec rspec
build:
needs:
- tests
- target_name

runs-on: ubuntu-latest

if: ${{needs.target_name.outputs.name == 'master'}}

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Set up authorization
run: |
mkdir -p ~/.gem
touch ~/.gem/credentials
chmod 600 ~/.gem/credentials
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
- name: Build
run: |
find . -name '*.gemspec' -maxdepth 1 -exec gem build {} \;
- name: Deploy
run: |
find . -name '*.gem' -maxdepth 1 -exec gem push --key github --host "https://rubygems.pkg.github.com/trustfractal" {} \;

0 comments on commit cbe7601

Please sign in to comment.