Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/actions/deploy-to-gh-pages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,37 @@ runs:
id: deployment
uses: actions/deploy-pages@v4

- name: Sync content to gh-pages branch
shell: bash
run: |
cd "${{ inputs.content-path }}"

git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

if [ ! -d ".git" ]; then
git init -b gh-pages
git remote add origin "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git"
else
# Ensure we're on gh-pages branch (the failed checkout may have
# left us on 'master' after git init with no gh-pages ref)
CURRENT_BRANCH=$(git branch --show-current 2>/dev/null || echo "")
if [ "$CURRENT_BRANCH" != "gh-pages" ]; then
git checkout -B gh-pages
fi
# Ensure remote URL uses the token for authentication
git remote set-url origin "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git" 2>/dev/null || \
git remote add origin "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git"
fi

git add -A
if git diff --cached --quiet; then
echo "gh-pages branch already up to date"
else
git commit -m "Sync: ${{ inputs.deployment-name }}"
git push origin gh-pages
fi

- name: Deployment summary
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
name: Deploy Picasso docs
runs-on: ubuntu-latest
concurrency:
group: gh-pages-deployment-pr
group: gh-pages-deployment
cancel-in-progress: false
permissions:
contents: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cleanup-previews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ on:
- force_all

concurrency:
group: gh-pages-deployment-pr
group: gh-pages-deployment
cancel-in-progress: false

jobs:
Expand Down
Loading