mirror of
https://github.com/django-components/django-components.git
synced 2025-09-19 20:29:44 +00:00
ci: Make a separate PR when pushing release benchmark data (#1045)
This commit is contained in:
parent
c034b7da65
commit
f54f3ccb0b
1 changed files with 22 additions and 6 deletions
28
.github/workflows/docs.yml
vendored
28
.github/workflows/docs.yml
vendored
|
@ -46,11 +46,6 @@ jobs:
|
|||
|
||||
- name: Configure git
|
||||
run: |
|
||||
# Get the master branch so we can run benchmarks on it
|
||||
git remote add upstream https://github.com/${{ github.repository }}.git
|
||||
git fetch origin master:master
|
||||
git checkout master
|
||||
|
||||
# required for "mike deploy" command below which pushes to gh-pages
|
||||
git config user.name github-actions
|
||||
git config user.email github-actions@github.com
|
||||
|
@ -62,6 +57,11 @@ jobs:
|
|||
- name: Run benchmarks for tag
|
||||
if: github.ref_type == 'tag' && github.event_name == 'push'
|
||||
run: |
|
||||
# Get the master branch so we can run benchmarks on it
|
||||
git remote add upstream https://github.com/${{ github.repository }}.git
|
||||
git fetch origin master:master
|
||||
git checkout master
|
||||
|
||||
# Get tag name
|
||||
TAG=${GITHUB_REF#refs/tags/}
|
||||
echo "TAG: $TAG"
|
||||
|
@ -117,14 +117,30 @@ jobs:
|
|||
echo "Benchmarks site DONE."
|
||||
|
||||
# Stage and commit benchmark results
|
||||
# 1. Create a new branch and commit benchmark results
|
||||
echo "Staging and committing benchmark results..."
|
||||
git checkout -b "benchmark-${TAG}"
|
||||
git add .asv/results/
|
||||
git add docs/benchmarks/
|
||||
git commit -m "Add benchmark results for ${TAG}"
|
||||
echo "Benchmark results committed."
|
||||
git push origin master
|
||||
|
||||
# 2. Push to the new branch
|
||||
echo "Pushing benchmark results to new branch..."
|
||||
git push -u origin "benchmark-${TAG}"
|
||||
|
||||
# 3. Create a PR
|
||||
PR_URL="$(gh pr create --title "chore: Add benchmark results for ${TAG}" --body "Add benchmark results for ${TAG}" --base master)"
|
||||
echo "PR URL: ${PR_URL}"
|
||||
|
||||
# 4. Merge the PR
|
||||
gh pr merge "${PR_URL}" --admin --squash --delete-branch
|
||||
echo "Benchmark results pushed to master."
|
||||
|
||||
# 5. Go back to the original branch
|
||||
git checkout master
|
||||
git pull
|
||||
|
||||
##############################
|
||||
# BUILD & DEPLOY DOCS
|
||||
##############################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue