-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
faeae07
commit 56e60a8
Showing
2 changed files
with
53 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Auto update Structurizr Diagrams | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'docs/workspace.dsl' # This setting will have the action trigger only if certain file changes. Set the location of your DSL. | ||
- '.github/workflows/autoupdate-structurizr-diagrams.yml' # Useful for testing purposes | ||
|
||
jobs: | ||
update-diagrams: | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/sebastienfi/structurizr-cli-with-bonus:latest | ||
permissions: | ||
contents: write # Allow to work with the contents of the repository, including git push. | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- name: Set up git | ||
# This step needs to be done before checkout so that the checkout respects clrf | ||
uses: canonical/ubuntu-pro-for-wsl/.github/actions/setup-git@main | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Generate Diagram Images | ||
shell: bash | ||
run: | | ||
set -eu | ||
echo "Actual folder is" | ||
echo ${PWD} | ||
/usr/local/structurizr-cli/structurizr.sh export -workspace 'docs/workspace.dsl' -format plantuml -output 'docs/diagrams' | ||
cd 'docs/diagrams' | ||
echo 'Generating PNGs...' | ||
plantuml -tpng *.puml | ||
#- name: Find diagram images changes | ||
# id: check-diff | ||
# uses: canonical/desktop-engineering/gh-actions/common/has-diff@main | ||
# with: | ||
# working-directory: "docs/diagrams" | ||
# fail-on-diff: false | ||
- name: Get output branch for branch name | ||
id: get-branch-name | ||
shell: bash | ||
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT | ||
- name: Create Pull Request if there is a diff | ||
#if: steps.check-diff.outputs.diff == 'true' | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
commit-message: Auto update diagrams | ||
title: 'docs: Auto update diagram files' | ||
labels: docs, automated pr | ||
body: "[Auto-generated pull request](https://github.com/canonical/ubuntu-pro-for-wsl/actions/workflows/autoupdate-structurizr-diagrams.yml) by GitHub Action" | ||
branch: autoupdate-diagrams-${{ steps.get-branch-name.outputs.branch }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
delete-branch: true |
This file was deleted.
Oops, something went wrong.