Skip to content

Commit

Permalink
NEW: Make use of generic workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmcal committed May 20, 2024
1 parent 169cdc8 commit ca2a599
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
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 +42,7 @@ jobs:
with:
name: Development
target: development
tag-name: "gmmcal/gmmcal:development"
image: "gmmcal/gmmcal:development"

deploy_staging:
name: Deploy
Expand Down
44 changes: 25 additions & 19 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,34 @@ jobs:
# DOCKER
build:
name: Build Image
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@v0
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@make-more-reusable
secrets: inherit
with:
name: Test
image: "gmmcal/gmmcal:test"

cypress:
name: Build Image
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@v0
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@make-more-reusable
secrets: inherit
with:
name: Cypress
target: cypress
tag-name: "gmmcal/gmmcal:cypress"
image: "gmmcal/gmmcal:cypress"

preview:
name: Build Image
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@v0
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@make-more-reusable
secrets: inherit
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:
name: Build Image
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@v0
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@make-more-reusable
secrets: inherit
with:
name: Development
Expand All @@ -46,7 +47,7 @@ jobs:

production:
name: Build Image
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@v0
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_docker.yml@make-more-reusable
secrets: inherit
with:
name: Production
Expand All @@ -56,47 +57,47 @@ jobs:
# LINT
rubocop:
name: Lint
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@v0
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@make-more-reusable
with:
name: Rubocop
command: bundle exec rubocop --config .rubocop.yml .
needs: build

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

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

scsslint:
name: Lint
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@v0
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@make-more-reusable
with:
name: SCSSLint
command: bundle exec scss-lint --config .scss-lint.yml
needs: build

bundler-audit:
name: Lint
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@v0
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@make-more-reusable
with:
name: Bundler Audit
command: bundle exec bundle-audit check --update
needs: build

eslint:
name: Lint
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@v0
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@make-more-reusable
with:
name: ESLint
command: yarn eslint
Expand All @@ -105,7 +106,7 @@ jobs:

eslint_tests:
name: Lint
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@v0
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_lint.yml@make-more-reusable
with:
name: ESLint - Tests
command: yarn eslint:tests
Expand All @@ -115,32 +116,37 @@ jobs:
# TESTS
tests:
name: Tests
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_tests.yml@v0
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_tests.yml@make-more-reusable
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
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_cypress.yml@make-more-reusable
with:
image: gmmcal/gmmcal:cypress
application-image: gmmcal/gmmcal:test
pattern: spec/end-to-end/tests/admin/**.js
name: Admin
needs: [build, cypress]

e2e-frontend:
name: Tests
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_cypress.yml@v0
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_cypress.yml@make-more-reusable
with:
image: gmmcal/gmmcal:cypress
application-image: gmmcal/gmmcal:test
pattern: spec/end-to-end/tests/frontend/**.js
name: Frontend
needs: [build, cypress]

# Preview and Cleanup
deploy:
name: Preview
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_preview.yml@v0
uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_preview.yml@make-more-reusable
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 ca2a599

Please sign in to comment.