Update pcb_render.yml

This commit is contained in:
Gabriel Koppenstein authored and GitHub committed 2024-11-26 15:11:52 +01:00
1 parent c65afef54f
commit cb6669992f
1 file changed
+35 -13
+35 -13
View File
@@ -1,4 +1,4 @@
name: Render PCB images name: pcb_image
on: on:
push: push:
branches: branches:
@@ -43,12 +43,23 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }} url: ${{ steps.deployment.outputs.page_url }}
steps: steps:
- name: Deploy to GitHub Pages (main) - name: Checkout the repository
if: github.ref == 'refs/heads/main' uses: actions/checkout@v4
uses: actions/deploy-pages@v2
with: - name: Set up git
token: ${{ secrets.GITHUB_TOKEN }} run: |
artifact_name: pcb-images # Name of the uploaded artifact git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
- name: Create or update gh-pages branch (main)
run: |
git fetch origin gh-pages || echo "gh-pages branch does not exist"
git checkout -b gh-pages || git checkout gh-pages
git reset --hard origin/gh-pages
cp -r images/* . # Copy the rendered images to the root directory
git add .
git commit -m "Deploy PCB images to gh-pages"
git push origin gh-pages --force
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
@@ -64,9 +75,20 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }} url: ${{ steps.deployment.outputs.page_url }}
steps: steps:
- name: Deploy to GitHub Pages (dev) - name: Checkout the repository
if: github.ref == 'refs/heads/dev' uses: actions/checkout@v4
uses: actions/deploy-pages@v2
with: - name: Set up git
token: ${{ secrets.GITHUB_TOKEN }} run: |
artifact_name: pcb-images # Name of the uploaded artifact git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
- name: Create or update gh-pages-dev branch (dev)
run: |
git fetch origin gh-pages-dev || echo "gh-pages-dev branch does not exist"
git checkout -b gh-pages-dev || git checkout gh-pages-dev
git reset --hard origin/gh-pages-dev
cp -r images/* . # Copy the rendered images to the root directory
git add .
git commit -m "Deploy PCB images to gh-pages-dev"
git push origin gh-pages-dev --force