-
Notifications
You must be signed in to change notification settings - Fork 16
50 lines (43 loc) · 1.83 KB
/
update-website-examples.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: update_website_specification_examples
on: workflow_dispatch
jobs:
specification_examples:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
with:
path: SBOL-visual
- name: Checkout website repo
uses: actions/checkout@v2
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
repository: SynBioDex/SbolStandardWebsite
path: SbolStandardWebsite
- name: Generate PNG versions of example diagrams
run: |
sudo apt-get update && sudo apt-get install ghostscript
sudo sed -i 's/^.*policy.*coder.*none.*PDF.*//' /etc/ImageMagick-6/policy.xml
cd SBOL-visual/specification/figures/apdx-examples/
pwd
ls -al
for file in *.pdf; do convert $file -background white -flatten "./pngversions/`basename $file .pdf`.png"; done
- name: Generate markdown glyph examples page
run: |
cd SBOL-visual/scripts
python3 generate_examples_appendix.py
- name: Copy generated files to website repo
run: |
cd SBOL-visual
cp scripts/examples.md ../SbolStandardWebsite/content/visual-spec-examples/_index.md
cp -r specification/figures/apdx-examples/pngversions/* ../SbolStandardWebsite/static/media/SBOLVisualSpecExamples
- name: Commit and push to website repo
if: ${{ github.event_name == 'push' }}
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
cd SbolStandardWebsite
git config --global user.email "[email protected]"
git config --global user.name "Specification Examples Github Action"
git add .
git diff-index --quiet HEAD || (git commit -m "Automatically re-generate specification examples" && git push origin master)