Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Commit

Permalink
Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zhulik committed Feb 9, 2023
1 parent 9531eb0 commit 423d303
Showing 1 changed file with 38 additions and 20 deletions.
58 changes: 38 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,45 @@
name: Ruby
name: Main

on:
push:
branches:
- main

pull_request:
- push
- workflow_dispatch

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true

- name: Run rubocop
run: bundle exec rubocop
test:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- '3.1.2'
steps:
- uses: actions/checkout@v2

- uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Run rspec
run: bundle exec rspec

publish_docker:
needs:
- lint
- test
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake
- uses: actions/checkout@v2

- name: Build and publish to ghcr.io
uses: macbre/push-to-ghcr@master
with:
image_name: ${{ github.repository }}
github_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 423d303

Please sign in to comment.