Skip to content

Commit

Permalink
chore: run workflows on ci complete (#33)
Browse files Browse the repository at this point in the history
* chore: run workflows on ci complete

* docs: update badges

* chore: add coverage report paths sonar
  • Loading branch information
ashleyjtaylor authored Mar 11, 2024
1 parent 382f14b commit 682ab77
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 14 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ permissions:
contents: read

on:
push:
branches:
- main
paths:
- '.github/workflows/infrastructure.yml'
- 'infrastructure/src/env/**'
- '!**/*.md'
workflow_run:
workflows: ["ci"]
branches: [main]
types:
- completed

workflow_dispatch:
inputs:
Expand All @@ -25,8 +23,30 @@ on:
required: true
default: 'dev'

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
changes:
runs-on: ubuntu-latest
outputs:
infrastructure: ${{ steps.filter.outputs.infrastructure }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dorny/paths-filter@v3
id: filter
with:
base: main
filters: |
infrastructure:
- '.github/workflows/infrastructure.yml'
- 'infrastructure/src/env/**'
- '!**/*.md'
dev:
if: ${{ needs.changes.outputs.infrastructure == 'true' }}
needs: [changes]
runs-on: ubuntu-latest
environment: dev
steps:
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@ permissions:
contents: read

on:
push:
branches:
- main
paths:
- '.github/workflows/tools.yml'
- 'infrastructure/src/tools/**'
- '!**/*.md'
workflow_run:
workflows: ["ci"]
branches: [main]
types:
- completed

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
changes:
runs-on: ubuntu-latest
outputs:
infrastructure: ${{ steps.filter.outputs.infrastructure }}
baseimage: ${{ steps.filter.outputs.baseimage }}
steps:
- uses: actions/checkout@v4
Expand All @@ -33,10 +32,15 @@ jobs:
with:
base: main
filters: |
infrastructure:
- '.github/workflows/tools.yml'
- 'infrastructure/src/tools/**'
- '!**/*.md'
baseimage:
- 'infrastructure/src/tools/images/Dockerfile.base'
deploy:
if: ${{ needs.changes.outputs.infrastructure == 'true' }}
needs: [changes]
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SaaS

![CI](https://github.com/ashleyjtaylor/saas/actions/workflows/ci.yml/badge.svg)
![Tools](https://github.com/ashleyjtaylor/saas/actions/workflows/tools.yml/badge.svg)
![Infrastructure](https://github.com/ashleyjtaylor/saas/actions/workflows/infrastructure.yml/badge.svg)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ashleyjtaylor_saas&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ashleyjtaylor_saas)

Expand Down
1 change: 1 addition & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ sonar.projectKey=ashleyjtaylor_saas
sonar.verbose=false
sonar.sources=infrastructure
sonar.exclusions=**/__tests__/**
sonar.javascript.lcov.reportPaths=./coverage/lcov.info

0 comments on commit 682ab77

Please sign in to comment.