Skip to content

Commit

Permalink
Merge pull request #74 from gmmcal/reusable-workflows
Browse files Browse the repository at this point in the history
NEW: Move to reusable workflows
  • Loading branch information
gmmcal committed May 20, 2024
2 parents d50735e + b4f01c2 commit 096e8ef
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 233 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/_docker.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/_lint.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/_release.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/_tests.yml

This file was deleted.

35 changes: 27 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,41 @@ on:
push:
branches:
- main
release:
types: [published]
workflow_call:

concurrency:
group: deploy
cancel-in-progress: false

jobs:
tag:
name: "Tag: Production"
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_tag.yml@v0

release:
name: Release
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_release.yml@v0
secrets: inherit
needs: tag
with:
tag: ${{needs.tag.outputs.version}}

build_production:
name: "Build: Production"
uses: ./.github/workflows/_docker.yml
name: Build
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@v0
needs:
- tag
secrets: inherit
with:
name: Production
target: production
reference: ${{needs.tag.outputs.version}}
image: "gmmcal/ynab:${{needs.tag.outputs.version}},gmmcal/ynab:production"

build_development:
name: "Build: Development"
uses: ./.github/workflows/_docker.yml
name: Build
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@v0
secrets: inherit
with:
name: Development
target: development
if: github.event_name == 'push'
image: "gmmcal/ynab:development"
63 changes: 43 additions & 20 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,82 @@ name: Pipeline
on:
- pull_request

concurrency:
group: pull-request-${{ github.ref }}
cancel-in-progress: true

jobs:
# DOCKER
build:
name: Test
uses: ./.github/workflows/_docker.yml
name: Build Image
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@v0
secrets: inherit
with:
name: Test
image: "gmmcal/ynab:test"

development:
name: Development
uses: ./.github/workflows/_docker.yml
name: Build Image
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@v0
secrets: inherit
with:
name: Development
target: development
publish: false
image: gmmcal/ynab:development

production:
name: Production
uses: ./.github/workflows/_docker.yml
name: Build Image
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@v0
secrets: inherit
with:
name: Production
target: production
publish: false
image: gmmcal/ynab:production

# LINT
rubocop:
name: Rubocop
uses: ./.github/workflows/_lint.yml
name: Lint
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@v0
with:
name: Rubocop
image: gmmcal/ynab:test
command: bundle exec rubocop --config .rubocop.yml .
needs: build

reek:
name: Reek
uses: ./.github/workflows/_lint.yml
name: Lint
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@v0
with:
name: Reek
image: gmmcal/ynab:test
command: bundle exec reek --config .reek.yml .
needs: build

brakeman:
name: Brakeman
uses: ./.github/workflows/_lint.yml
name: Lint
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@v0
with:
name: Brakeman
image: gmmcal/ynab:test
command: bundle exec brakeman
needs: build

tests:
name: Backend
uses: ./.github/workflows/_tests.yml
bundler-audit:
name: Lint
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@v0
with:
command: bundle exec rails test
name: Bundler Audit
image: gmmcal/ynab:test
command: bundle exec bundle-audit check --update
needs: build

bundler-audit:
name: Bundler Audit
uses: ./.github/workflows/_lint.yml
# TESTS
tests:
name: Tests
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_tests.yml@v0
with:
command: bundle exec bundle-audit check --update
image: gmmcal/ynab:test
command: bundle exec rails test
needs: build
67 changes: 0 additions & 67 deletions .github/workflows/tag.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.2.2'
ruby '~> 3.2.2'

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem 'rails', '~> 7.1.3'
Expand Down

0 comments on commit 096e8ef

Please sign in to comment.