Update pcb_render.yml
This commit is contained in:
1 parent
d862355199
commit
c65afef54f
1 file changed
+13
-15
@@ -1,4 +1,4 @@
|
|||||||
name: pcb_image
|
name: Render PCB images
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
@@ -22,14 +22,12 @@ jobs:
|
|||||||
pcb_file: KiCad/RP2040-Decoder.kicad_pcb
|
pcb_file: KiCad/RP2040-Decoder.kicad_pcb
|
||||||
output_path: ${{ github.workspace }}/images
|
output_path: ${{ github.workspace }}/images
|
||||||
|
|
||||||
- name: Commit and push rendered images to the repository
|
- name: Upload images as artifact
|
||||||
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' # Run on both dev and main branches
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
|
||||||
run: |
|
uses: actions/upload-artifact@v3
|
||||||
git config --global user.name "github-actions"
|
with:
|
||||||
git config --global user.email "github-actions@github.com"
|
name: pcb-images
|
||||||
git add images
|
path: images/
|
||||||
git commit -m "Add rendered PCB images"
|
|
||||||
git push origin ${{ github.ref }} # Push to the same branch that triggered the workflow
|
|
||||||
|
|
||||||
deploy-pages-main:
|
deploy-pages-main:
|
||||||
if: github.ref == 'refs/heads/main' # Only deploy on 'main' branch
|
if: github.ref == 'refs/heads/main' # Only deploy on 'main' branch
|
||||||
@@ -46,11 +44,11 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Deploy to GitHub Pages (main)
|
- name: Deploy to GitHub Pages (main)
|
||||||
id: deployment
|
if: github.ref == 'refs/heads/main'
|
||||||
uses: actions/deploy-pages@v2
|
uses: actions/deploy-pages@v2
|
||||||
with:
|
with:
|
||||||
branch: main # Ensure deployment is for the 'main' branch
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
folder: images # Specify the folder to deploy (can be images or any other folder)
|
artifact_name: pcb-images # Name of the uploaded artifact
|
||||||
|
|
||||||
deploy-pages-dev:
|
deploy-pages-dev:
|
||||||
if: github.ref == 'refs/heads/dev' # Only deploy on 'dev' branch
|
if: github.ref == 'refs/heads/dev' # Only deploy on 'dev' branch
|
||||||
@@ -67,8 +65,8 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Deploy to GitHub Pages (dev)
|
- name: Deploy to GitHub Pages (dev)
|
||||||
id: deployment
|
if: github.ref == 'refs/heads/dev'
|
||||||
uses: actions/deploy-pages@v2
|
uses: actions/deploy-pages@v2
|
||||||
with:
|
with:
|
||||||
branch: dev # Ensure deployment is for the 'dev' branch
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
folder: images # Specify the folder to deploy (can be images or any other folder)
|
artifact_name: pcb-images # Name of the uploaded artifact
|
||||||
Reference in new issue
Block a user