Skip to content

Commit

Permalink
Update static.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
matth3wss authored Oct 9, 2023
1 parent 5961e38 commit 103699c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Copy src to gh-pages

on:
push:
branches: [ main ]
branches:
- main

jobs:
copy-src-to-gh-pages:
Expand All @@ -15,16 +16,21 @@ jobs:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
- name: Pull changes from remote gh-pages branch
run: |
git pull origin gh-pages || true
- name: Create gh-pages branch if it does not exist
run: |
git checkout -b gh-pages || true
- name: Copy src to gh-pages
run: |
git checkout gh-pages
git rm -rf .
git checkout main -- src
git checkout gh-pages -- src
rm -rf *
git checkout main -- src/*
mv src/* .
rmdir src
git add .
git commit -m "Copied src from main"
git push origin gh-pages

0 comments on commit 103699c

Please sign in to comment.