From 99901debcfcdb48d660073ebf5da4b63034be195 Mon Sep 17 00:00:00 2001 From: Gustavo Cunha Date: Mon, 20 May 2024 14:53:17 +0200 Subject: [PATCH] NEW: Make use of generic workflows --- .github/workflows/deploy.yml | 5 ++--- .github/workflows/pull_request.yml | 23 ++++++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fc2d55d3..163f4b61 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 @@ -42,7 +41,7 @@ jobs: with: name: Development target: development - tag-name: "gmmcal/gmmcal:development" + image: "gmmcal/gmmcal:development" deploy_staging: name: Deploy diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index e7ae2882..20079c1d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -15,6 +15,7 @@ jobs: secrets: inherit with: name: Test + image: "gmmcal/gmmcal:test" cypress: name: Build Image @@ -23,7 +24,7 @@ jobs: with: name: Cypress target: cypress - tag-name: "gmmcal/gmmcal:cypress" + image: "gmmcal/gmmcal:cypress" preview: name: Build Image @@ -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: @@ -43,6 +44,7 @@ jobs: name: Development target: development publish: false + image: gmmcal/gmmcal:development production: name: Build Image @@ -52,6 +54,7 @@ jobs: name: Production target: production publish: false + image: gmmcal/gmmcal:production # LINT rubocop: @@ -59,6 +62,7 @@ jobs: 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -99,8 +107,8 @@ 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: @@ -108,8 +116,8 @@ jobs: 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 @@ -117,6 +125,7 @@ jobs: name: Tests uses: gmmcal/gmmcal-reusable-workflows/.github/workflows/_tests.yml@v0 with: + image: gmmcal/gmmcal:test command: bundle exec rspec needs: build @@ -124,6 +133,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/admin/**.js name: Admin needs: [build, cypress] @@ -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] @@ -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 }}"