Skip to content

Commit

Permalink
Merge pull request #1245 from gmmcal/generic-workflows
Browse files Browse the repository at this point in the history
NEW: Make use of generic workflows
  • Loading branch information
gmmcal committed May 20, 2024
2 parents 169cdc8 + 99901de commit 0c5ffde
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ jobs:
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@v0
needs:
- tag
- release
secrets: inherit
with:
name: Production
target: production
reference: ${{needs.tag.outputs.version}}
tag-name: "gmmcal/gmmcal:${{needs.tag.outputs.version}},gmmcal/gmmcal:production"
image: "gmmcal/gmmcal:${{needs.tag.outputs.version}},gmmcal/gmmcal:production"

build_development:
name: Build
Expand All @@ -42,7 +41,7 @@ jobs:
with:
name: Development
target: development
tag-name: "gmmcal/gmmcal:development"
image: "gmmcal/gmmcal:development"

deploy_staging:
name: Deploy
Expand Down
23 changes: 18 additions & 5 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
secrets: inherit
with:
name: Test
image: "gmmcal/gmmcal:test"

cypress:
name: Build Image
Expand All @@ -23,7 +24,7 @@ jobs:
with:
name: Cypress
target: cypress
tag-name: "gmmcal/gmmcal:cypress"
image: "gmmcal/gmmcal:cypress"

preview:
name: Build Image
Expand All @@ -32,7 +33,7 @@ jobs:
with:
name: Preview
target: production
tag-name: "gmmcal/gmmcal:preview-${{ github.event.number }}-${{ github.run_number }}"
image: "gmmcal/gmmcal:preview-${{ github.event.number }}-${{ github.run_number }}"
publish: true

development:
Expand All @@ -43,6 +44,7 @@ jobs:
name: Development
target: development
publish: false
image: gmmcal/gmmcal:development

production:
name: Build Image
Expand All @@ -52,13 +54,15 @@ jobs:
name: Production
target: production
publish: false
image: gmmcal/gmmcal:production

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

Expand All @@ -67,6 +71,7 @@ jobs:
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@v0
with:
name: Reek
image: gmmcal/gmmcal:test
command: bundle exec reek --config .reek.yml .
needs: build

Expand All @@ -75,6 +80,7 @@ jobs:
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@v0
with:
name: Brakeman
image: gmmcal/gmmcal:test
command: bundle exec brakeman
needs: build

Expand All @@ -83,6 +89,7 @@ jobs:
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@v0
with:
name: SCSSLint
image: gmmcal/gmmcal:test
command: bundle exec scss-lint --config .scss-lint.yml
needs: build

Expand All @@ -91,6 +98,7 @@ jobs:
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@v0
with:
name: Bundler Audit
image: gmmcal/gmmcal:test
command: bundle exec bundle-audit check --update
needs: build

Expand All @@ -99,31 +107,34 @@ jobs:
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@v0
with:
name: ESLint
command: yarn eslint
image: gmmcal/gmmcal:cypress
command: yarn eslint
needs: cypress

eslint_tests:
name: Lint
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@v0
with:
name: ESLint - Tests
command: yarn eslint:tests
image: gmmcal/gmmcal:cypress
command: yarn eslint:tests
needs: cypress

# TESTS
tests:
name: Tests
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_tests.yml@v0
with:
image: gmmcal/gmmcal:test
command: bundle exec rspec
needs: build

e2e-admin:
name: Tests
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_cypress.yml@v0
with:
image: gmmcal/gmmcal:cypress
application-image: gmmcal/gmmcal:test
pattern: spec/end-to-end/tests/admin/**.js
name: Admin
needs: [build, cypress]
Expand All @@ -132,6 +143,8 @@ jobs:
name: Tests
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_cypress.yml@v0
with:
image: gmmcal/gmmcal:cypress
application-image: gmmcal/gmmcal:test
pattern: spec/end-to-end/tests/frontend/**.js
name: Frontend
needs: [build, cypress]
Expand All @@ -143,4 +156,4 @@ jobs:
needs: preview
secrets: inherit
with:
tag-name: "gmmcal/gmmcal:preview-${{ github.event.number }}-${{ github.run_number }}"
image: "gmmcal/gmmcal:preview-${{ github.event.number }}-${{ github.run_number }}"

0 comments on commit 0c5ffde

Please sign in to comment.