Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
factoryjp committed Sep 8, 2023
1 parent 9890fc7 commit 7e37585
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/openscad_build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generate and Deploy OpenSCAD preview to GitHub Pages
name: Generate STL and WebP Thumbnails using OpenSCAD

on:
push:
Expand All @@ -13,21 +13,35 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install OpenSCAD
run: sudo apt-get install -y openscad
- name: Install OpenSCAD and WebP tools
run: |
sudo apt-get update
sudo apt-get install -y openscad webp
- name: Generate STL files
- name: Generate STL files and PNG thumbnails
run: |
find . -name "*.scad" | grep -v "^./lib/" | while read scad; do
stl_path="${scad%.scad}.stl"
png_path="${scad%.scad}.png"
openscad -o $stl_path $scad
openscad --render --imgsize=256,256 -o $png_path $scad
done
- name: Convert PNG thumbnails to WebP
run: |
for png in $(find . -name "*.png"); do
cwebp $png -o ${png%.png}.webp
done
- name: Clean up directory (Only keep STL and WebP files)
run: |
find . -type f ! -name "*.stl" ! -name "*.webp" -delete
- name: Deploy to GitHub Pages
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<email>@users.noreply.github.com"
git checkout -b gh-pages
git add ./*.stl **/*.stl
git commit -m "Update STL files generated by GitHub Actions"
git add ./*.stl **/*.stl ./*.webp **/*.webp
git commit -m "Update STL files and WebP thumbnails generated by GitHub Actions"
git push -f origin gh-pages
1 change: 1 addition & 0 deletions chocv1_08u/test1.scad
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// https://qiita.com/zk_phi/items/ab99315ebaef66e84aa0
// https://bebebe.hatenablog.jp/entry/2019/06/04/232501

$fs = 0.1;

Expand Down

0 comments on commit 7e37585

Please sign in to comment.