-
Notifications
You must be signed in to change notification settings - Fork 31
111 lines (96 loc) · 3.57 KB
/
Copy pathpcb_render.yml
File metadata and controls
111 lines (96 loc) · 3.57 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Render PCB images and rotating mp4
on:
push:
branches:
- dev # Trigger on push to 'dev' branch
- main # Trigger on push to 'main' branch
paths:
- '.github/workflows/pcb_render.yml' # Trigger if this workflow file changes
- 'KiCad/**' # Trigger if any file in the 'KiCad' directory changes
jobs:
render-images:
name: render-images
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Render PCB image and .mp4 (USB Hardware Revision)
uses: linalinn/kicad-render@main
with:
pcb_file: KiCad/USB/RP2040-Decoder.kicad_pcb
output_path: ${{ github.workspace }}/images_USB
animation: mp4
- name: Render PCB image and .mp4 (Legacy Hardware Revision)
uses: linalinn/kicad-render@main
with:
pcb_file: KiCad/Legacy/RP2040-Decoder.kicad_pcb
output_path: ${{ github.workspace }}/images_Legacy
animation: mp4
- name: Upload images and mp4 as artifact (USB Hardware Revision)
uses: actions/upload-artifact@v4
with:
name: pcb-images_USB
path: images_USB/
- name: Upload images and mp4 as artifact (Legacy Hardware Revision)
uses: actions/upload-artifact@v4
with:
name: pcb-images_Legacy
path: images_Legacy/
deploy-pages-main:
if: github.ref == 'refs/heads/main' # Only deploy on 'main' branch
runs-on: ubuntu-latest
needs: render-images
steps:
- name: Download pcb-images_USB artifact
uses: actions/download-artifact@v4
with:
name: pcb-images_USB
path: images_USB/
- name: Download pcb-images_Legacy artifact
uses: actions/download-artifact@v4
with:
name: pcb-images_Legacy
path: images_Legacy/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./images_USB
publish_branch: gh-pages # Specify the target branch (gh-pages in this case)
destination_dir: img_USB
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./images_Legacy
publish_branch: gh-pages # Specify the target branch (gh-pages in this case)
destination_dir: img_Legacy
deploy-pages-dev:
if: github.ref == 'refs/heads/dev' # Only deploy on 'dev' branch
runs-on: ubuntu-latest
needs: render-images
steps:
- name: Download pcb-images_USB artifact
uses: actions/download-artifact@v4
with:
name: pcb-images_USB
path: images_USB/
- name: Download pcb-images_Legacy artifact
uses: actions/download-artifact@v4
with:
name: pcb-images_Legacy
path: images_Legacy/
- name: Deploy USB Hardware Revision
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./images_USB
publish_branch: gh-pages-dev # Specify the target branch (gh-pages-dev in this case)
destination_dir: img_USB
- name: Deploy Legacy Hardware Revision
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./images_Legacy
publish_branch: gh-pages-dev # Specify the target branch (gh-pages-dev in this case)
destination_dir: img_Legacy