Skip to content

Commit

Permalink
feat: generate dependency chart (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorCastelli authored Nov 19, 2023
1 parent f449a6f commit ea904b7
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/graph.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Dependency Graph

concurrency:
cancel-in-progress: true
group: '${{ github.workflow }}'

on:
pull_request:

permissions:
contents: read

env:
terragrunt_version: '0.53.4'

jobs:
graph:
name: "Update Graph"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Install graphvix
run: sudo apt install graphviz
- uses: opentofu/setup-opentofu@v1
with:
tofu_wrapper: false
- uses: ./.github/actions/install-terragrunt
with:
version: ${{ env.terragrunt_version }}
- name: Generate graph
working-directory: stages
env:
GH_ADMIN_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }}
PG_CONN_STR: ${{ secrets.PG_CONN_STR }}
ELEPHANTSQL_APIKEY: ${{ secrets.ELEPHANTSQL_APIKEY }}
GANDI_KEY: ${{ secrets.GANDI_KEY }}
IMPROVMX_API_TOKEN: ${{ secrets.IMPROVMX_API_TOKEN }}
run: terragrunt graph-dependencies | sed '2d' | dot -T png > "$GITHUB_WORKSPACE/graph.png"
- name: GitHub Commit & Push
uses: actions-js/push@v1.4
with:
github_token: ${{ secrets.GH_ADMIN_TOKEN }}
message: "chore(graph): update graph dependencies"
branch: ${{ github.head_ref }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Stages are logical separation between systems, and can be, at first-glance,

Stages can only use environment variables or the outputs of other stages as input.

![Stage dependencies](./graph.png)

### Modules

Modules are repeatable packages of code that can be used in stages to abstract
Expand Down
2 changes: 2 additions & 0 deletions bootstrapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ This document will detail how to use this repository for the initial setup,

- Repository access: All repositories
- Repository permissions:
- Actions: Read and write
- Administration: Read and write
- Commit statuses: Read and write
- Contents: Read and write
- Issues: Read and write
- Metadata: Read-only
- Pull requests: Read and write
- Secrets: Read and write
- Workflows: Read and write
- Organization permissions:
Expand Down
Binary file added graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ea904b7

Please sign in to comment.