Skip to content

Commit 4b62295

Browse files
committed
add README.md with instructions
1 parent 86980a1 commit 4b62295

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

README.md

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# kicad render action (WIP)
2+
3+
This actions allows you to automaticly render Images of your pcb and use it e.g. in a README.md
4+
5+
### current state
6+
Rendering Image and Animations is working but the 3D models for kicad are missing since the offical docker image dose not contain the config that is created at first start up.
7+
8+
Even animation are renderd fine I wasn't able to embed them in to a README.md
9+
10+
Also this is using kicad nightly since there is yet no kicad relase containing the image rendering comand in the cli.
11+
12+
13+
## Usage
14+
1. Create the dirctory `.github/workflows` if it dose not already exists.
15+
16+
2. Add an new yaml in that dirctory e.g. pcb_image.yaml
17+
18+
3. Adding the configuration (you may need to replace `'refs/heads/main'` with `'refs/heads/master'` on older repos)
19+
```yaml
20+
name: pcb_image
21+
on:
22+
push:
23+
jobs:
24+
render-image:
25+
name: render-image
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Check out the repo
29+
uses: actions/checkout@v4
30+
31+
- name: render pcb image
32+
uses: linalinn/kicad-render@main
33+
with:
34+
pcb_file: m2sdr.kicad_pcb
35+
output_path: ${{ github.workspace }}/images
36+
37+
- name: Setup Pages
38+
if: github.ref == 'refs/heads/main'
39+
uses: actions/configure-pages@v3
40+
41+
- name: Upload Artifact
42+
if: github.ref == 'refs/heads/main'
43+
uses: actions/upload-pages-artifact@v1
44+
with:
45+
path: "images"
46+
47+
deploy-pages:
48+
if: github.ref == 'refs/heads/main'
49+
runs-on: ubuntu-latest
50+
needs: render-image
51+
52+
permissions:
53+
pages: write
54+
id-token: write
55+
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v2
64+
```
65+
66+
4. Adding the images to an README.md
67+
```Markdown
68+
# My first pcb with automaitc image generation
69+
70+
### Images
71+
![top](<github_username>.github.io/<repo_name>/images/top.png)
72+
![bottom](<github_username>.github.io/<repo_name>/images/bottom.png)
73+
```
74+
5. git commit and push
75+
76+
## Animation original code
77+
The [code](https://gist.github.com/arturo182/57ab066e6a4a36ee22979063e4d5cce1) for the Animation is from [arturo182](https://github.com/arturo182)
78+
[Mastdon post with Gif and link to gist](https://mastodon.social/@arturo182/112062074668232493)

0 commit comments

Comments
 (0)