-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (54 loc) · 1.53 KB
/
render-demos.yml
File metadata and controls
61 lines (54 loc) · 1.53 KB
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
51
52
53
54
55
56
57
58
59
60
61
name: Render demos
on:
push:
branches: [main]
paths:
- "configs/.pymolrc"
- "configs/.pymolrc.py"
- "scripts/demos/*.pml"
workflow_dispatch:
jobs:
render:
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
shell: bash -l {0}
name: Render demos
steps:
- uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
activate-environment: pymol
channels: conda-forge,defaults
use-mamba: true
- name: Install PyMOL
run: |
conda install -y pymol-open-source
- name: Render demos
env:
PYMOLRC: ${{ github.workspace }}/configs/.pymolrc
run: |
mkdir -p assets
for pml in scripts/demos/*.pml; do
name=$(basename "$pml" .pml)
echo "Rendering $name..."
xvfb-run -a pymol -cqxi -d "@${PYMOLRC}" "$pml"
done
ls -la assets/
- name: Commit rendered PNGs
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add assets/*.png
if git diff --staged --quiet; then
echo "No PNG changes"
else
git commit -m "chore: re-render demos after config update"
git push origin HEAD:${{ github.ref }}
fi