Skip to content

Commit

Permalink
Disconnect old CI/CD Back & Front workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Feb 28, 2024
1 parent 12a187b commit 8c2c282
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 81 deletions.
43 changes: 21 additions & 22 deletions .github/workflows/application_build.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
name: Application Build

on:
workflow_dispatch:
# push:
# paths:
# - "**.css"
# - "**.kt"
# - "**.png"
# - "**.js"
# - "**.json"
# - "**.snap"
# - "**.ts"
# - "**.tsx"
# - "**.yml"
# - ".github/workflows/cicd.yml"
# - "infra/configurations/**.properties"
# - "infra/docker/app/**"
# - "**.sql"
# - "backend/pom.xml"
# - "backend/build.gradle.kts"
# - "Makefile"
# - "frontend"
# schedule:
# - cron: "38 11 */3 * *"
push:
paths:
- "**.css"
- "**.kt"
- "**.png"
- "**.js"
- "**.json"
- "**.snap"
- "**.ts"
- "**.tsx"
- "**.yml"
- ".github/workflows/cicd.yml"
- "infra/configurations/**.properties"
- "infra/docker/app/**"
- "**.sql"
- "backend/pom.xml"
- "backend/build.gradle.kts"
- "Makefile"
- "frontend"
schedule:
- cron: "38 11 */3 * *"

jobs:
build:
Expand Down
22 changes: 6 additions & 16 deletions .github/workflows/application_deployment.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: CI/CD Back & Front

on:
workflow_dispatch:
# workflow_run:
# workflows:
# - "Application E2E Tests"
# types:
# - completed
workflow_run:
workflows:
- "Application E2E Tests"
types:
- completed

jobs:
push_to_registry:
Expand All @@ -15,40 +14,31 @@ jobs:
runs-on: ubuntu-22.04
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
ENV_PROFILE: ${{needs.version.outputs.ENV_PROFILE}}
VERSION: ${{needs.version.outputs.VERSION}}
steps:
- name: Check status of required workflows
id: should_deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
APLICATION_UNITS_TESTS_WORKFLOW_CONCLUSION=$(gh api repos/MTES-MCT/monitorfish/actions/runs --jq '.workflow_runs[] | select(.name=="Application Unit Tests").conclusion' | head -n 1)
APPLICATION_E2E_TESTS_WORKFLOW_CONCLUSION=$(gh api repos/MTES-MCT/monitorfish/actions/runs --jq '.workflow_runs[] | select(.name=="Application E2E Tests").conclusion' | head -n 1)
if [[ "$APLICATION_UNITS_TESTS_WORKFLOW_CONCLUSION" == "success" && "$APPLICATION_E2E_TESTS_WORKFLOW_CONCLUSION" == "success" ]]; then
echo "should-deploy=true" >> $GITHUB_OUTPUT
else
echo "should-deploy=false" >> $GITHUB_OUTPUT
if [[ "$APLICATION_UNITS_TESTS_WORKFLOW_CONCLUSION" != "success" || "$APPLICATION_E2E_TESTS_WORKFLOW_CONCLUSION" != "success" ]]; then
exit 1
fi
- name: Checkout
if: ${{ steps.should_deploy.outputs.should-deploy == 'true' }}
uses: actions/checkout@v4

- name: Set version and environment profile
uses: ./.github/actions/set-version-and-environment-profile

- name: Download image
if: ${{ steps.should_deploy.outputs.should-deploy == 'true' }}
uses: ishworkh/[email protected]
with:
image: monitorfish-app:${{ env.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
workflow: "Application Build"

- name: Push docker image to registry
if: ${{ steps.should_deploy.outputs.should-deploy == 'true' }}
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${GITHUB_ACTOR} --password-stdin
make docker-tag
Expand Down
43 changes: 21 additions & 22 deletions .github/workflows/application_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
name: Application Unit Tests

on:
workflow_dispatch:
# push:
# paths:
# - "**.css"
# - "**.kt"
# - "**.png"
# - "**.js"
# - "**.json"
# - "**.snap"
# - "**.ts"
# - "**.tsx"
# - "**.yml"
# - ".github/workflows/cicd.yml"
# - "infra/configurations/**.properties"
# - "infra/docker/app/**"
# - "**.sql"
# - "backend/pom.xml"
# - "backend/build.gradle.kts"
# - "Makefile"
# - "frontend"
# schedule:
# - cron: "38 11 */3 * *"
push:
paths:
- "**.css"
- "**.kt"
- "**.png"
- "**.js"
- "**.json"
- "**.snap"
- "**.ts"
- "**.tsx"
- "**.yml"
- ".github/workflows/cicd.yml"
- "infra/configurations/**.properties"
- "infra/docker/app/**"
- "**.sql"
- "backend/pom.xml"
- "backend/build.gradle.kts"
- "Makefile"
- "frontend"
schedule:
- cron: "38 11 */3 * *"

jobs:
unit_test_backend:
Expand Down
43 changes: 22 additions & 21 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
name: CI/CD Back & Front

on:
push:
paths:
- "**.css"
- "**.kt"
- "**.png"
- "**.js"
- "**.json"
- "**.snap"
- "**.ts"
- "**.tsx"
- "**.yml"
- ".github/workflows/cicd.yml"
- "infra/configurations/**.properties"
- "infra/docker/app/**"
- "**.sql"
- "backend/pom.xml"
- "backend/build.gradle.kts"
- "Makefile"
- "frontend"
schedule:
- cron: "38 11 */3 * *"
workflow_dispatch:
# push:
# paths:
# - "**.css"
# - "**.kt"
# - "**.png"
# - "**.js"
# - "**.json"
# - "**.snap"
# - "**.ts"
# - "**.tsx"
# - "**.yml"
# - ".github/workflows/cicd.yml"
# - "infra/configurations/**.properties"
# - "infra/docker/app/**"
# - "**.sql"
# - "backend/pom.xml"
# - "backend/build.gradle.kts"
# - "Makefile"
# - "frontend"
# schedule:
# - cron: "38 11 */3 * *"

jobs:
version:
Expand Down

0 comments on commit 8c2c282

Please sign in to comment.