@@ -36,31 +36,16 @@ jobs:
3636 --health-retries 5
3737
3838 steps :
39- - name : Check out repository code
40- uses : actions/checkout@v4
39+ - name : Check out this repo
40+ uses : actions/checkout@v5
4141
42- - name : Add GitHub to known_hosts
43- run : |
44- install -d -m 700 ~/.ssh
45- # Add ALL key types GitHub may present
46- ssh-keyscan -H -t rsa,ecdsa,ed25519 github.com >> ~/.ssh/known_hosts
47- chmod 644 ~/.ssh/known_hosts
48-
49- - name : Set up deploy key
50- run : |
51- echo "$DB_DOCS_DEPLOY_KEY" > ~/.ssh/id_ed25519
52- chmod 600 ~/.ssh/id_ed25519
53- env :
54- DB_DOCS_DEPLOY_KEY : ${{ secrets.DB_DOCS_DEPLOY_KEY }}
55-
56- - name : Check out docs repo
57- run : git clone git@github.com:rage/secret-project-331-db-docs.git db-docs
58- env :
59- GIT_SSH_COMMAND : >-
60- ssh -i ~/.ssh/id_ed25519
61- -o IdentitiesOnly=yes
62- -o StrictHostKeyChecking=yes
63- -o UserKnownHostsFile=~/.ssh/known_hosts
42+ - name : Check out docs repo (with an SSH deploy key)
43+ uses : actions/checkout@v5
44+ with :
45+ repository : rage/secret-project-331-db-docs
46+ path : db-docs
47+ fetch-depth : 0
48+ ssh-key : ${{ secrets.DB_DOCS_DEPLOY_KEY }}
6449
6550 - name : Setup database
6651 run : sqlx database setup
@@ -71,29 +56,26 @@ jobs:
7156 - name : Generate tbls docs
7257 run : tbls doc 'postgres://postgres:postgres@postgres/headless_lms_dev?sslmode=disable' db-docs --force --sort
7358
74- # Column comments can be quite long and they are a bit too much text for the whole
75- # entity relationship diagram so we'll remove them from the diagram.
76- # Note that the column comments are still visible from the markdown documentation.
7759 - name : Remove all column comments
7860 run : psql 'postgres://postgres:postgres@postgres/headless_lms_dev?sslmode=disable' -c 'DELETE FROM pg_description WHERE objsubid > 0;'
7961
80- - name : Generate uml with planter
62+ - name : Generate UML with planter
8163 run : planter 'postgres://postgres:postgres@postgres/headless_lms_dev?sslmode=disable' -o db-docs/schema.uml
8264
83- - name : Patch uml to work with wide comments
65+ - name : Patch UML for wide comments
8466 run : sed -i 's/skinparam linetype ortho/skinparam linetype ortho\nskinparam wrapWidth 300/' db-docs/schema.uml
8567
86- - name : Generate plantuml svg
68+ - name : Generate PlantUML SVG
8769 run : plantuml -tsvg schema.uml
8870 working-directory : ./db-docs
8971
90- - name : Generate html with Pandoc
72+ - name : Generate HTML with Pandoc
9173 run : |
9274 for f in *.md; do
93- # remove .md extension
9475 f2=${f%.md}
95- # convert to html
96- pandoc -f markdown -t html5 "$f" -o "$f2.html" --lua-filter=../misc/db-docs/pandoc-links-md-extension-to-html-extension.lua --template ../misc/db-docs/template.html
76+ pandoc -f markdown -t html5 "$f" -o "$f2.html" \
77+ --lua-filter=../misc/db-docs/pandoc-links-md-extension-to-html-extension.lua \
78+ --template ../misc/db-docs/template.html
9779 cp README.html index.html
9880 done
9981 working-directory : ./db-docs
10991 - name : Push changes
11092 run : git push
11193 working-directory : ./db-docs
112- env :
113- GIT_SSH_COMMAND : >-
114- ssh -i ~/.ssh/id_ed25519
115- -o IdentitiesOnly=yes
116- -o StrictHostKeyChecking=yes
117- -o UserKnownHostsFile=~/.ssh/known_hosts
0 commit comments