Update pcb_render.yml
This commit is contained in:
1 parent
0c225ee7f0
commit
a099ef67ed
1 file changed
+12
-3
@@ -57,14 +57,18 @@ jobs:
|
|||||||
name: pcb-images
|
name: pcb-images
|
||||||
path: images/
|
path: images/
|
||||||
|
|
||||||
|
- name: Stash changes before switching branches
|
||||||
|
run: git stash
|
||||||
|
|
||||||
- name: Deploy to gh-pages branch (main)
|
- name: Deploy to gh-pages branch (main)
|
||||||
run: |
|
run: |
|
||||||
git fetch --all # Ensure all branches are fetched
|
git fetch --all # Ensure all branches are fetched
|
||||||
git checkout gh-pages || git checkout --orphan gh-pages # Create gh-pages if it doesn't exist
|
git checkout gh-pages || git checkout --orphan gh-pages # Create gh-pages if it doesn't exist
|
||||||
|
git stash pop # Apply stashed changes
|
||||||
cp -r images/* . # Copy the rendered images to the root directory
|
cp -r images/* . # Copy the rendered images to the root directory
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Deploy PCB images to gh-pages"
|
git commit -m "Deploy PCB images to gh-pages"
|
||||||
git push origin gh-pages --force
|
git push origin gh-pages --force # Force push to gh-pages
|
||||||
|
|
||||||
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
|
||||||
@@ -72,9 +76,10 @@ jobs:
|
|||||||
needs: render-image
|
needs: render-image
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
contents: write # To allow writing to the repository (needed for pushing changes)
|
||||||
pages: write
|
pages: write
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
name: github-pages-dev
|
name: github-pages-dev
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
@@ -94,11 +99,15 @@ jobs:
|
|||||||
name: pcb-images
|
name: pcb-images
|
||||||
path: images/
|
path: images/
|
||||||
|
|
||||||
|
- name: Stash changes before switching branches
|
||||||
|
run: git stash
|
||||||
|
|
||||||
- name: Deploy to gh-pages-dev branch (dev)
|
- name: Deploy to gh-pages-dev branch (dev)
|
||||||
run: |
|
run: |
|
||||||
git fetch --all # Ensure all branches are fetched
|
git fetch --all # Ensure all branches are fetched
|
||||||
git checkout gh-pages-dev || git checkout --orphan gh-pages-dev # Create gh-pages-dev if it doesn't exist
|
git checkout gh-pages-dev || git checkout --orphan gh-pages-dev # Create gh-pages-dev if it doesn't exist
|
||||||
|
git stash pop # Apply stashed changes
|
||||||
cp -r images/* . # Copy the rendered images to the root directory
|
cp -r images/* . # Copy the rendered images to the root directory
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Deploy PCB images to gh-pages-dev"
|
git commit -m "Deploy PCB images to gh-pages-dev"
|
||||||
git push origin gh-pages-dev --force
|
git push origin gh-pages-dev --force # Force push to gh-pages-dev
|
||||||
Reference in new issue
Block a user