From cffe5662122245c4cca1a9ad2e91a69a651b8f7c Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Mon, 23 Dec 2024 18:22:33 +0100 Subject: [PATCH] ci: simplify GitHub Pages deployment process in CircleCI config --- .circleci/config.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 44ef8b6332..703aba3490 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -91,17 +91,12 @@ jobs: command: | pages_branch="gh-pages-test" - # Create or switch to gh-pages branch - if git ls-remote --heads origin ${pages_branch}; then - git fetch origin ${pages_branch} - git checkout ${pages_branch} - else - git checkout --orphan ${pages_branch} - git rm -rf . - fi + # Create new orphan branch without parent history + git checkout --orphan ${pages_branch} + git reset --hard # Remove all files from staging - # Clean existing files (equivalent to clean: true) - git rm -rf . + # Clean working directory + rm -rf * # Copy new files cp -a tmp/pages/. . @@ -109,6 +104,7 @@ jobs: # Commit and push git add . git commit -m "Deploy to GitHub Pages [skip ci]" + # git push origin ${pages_branch} --force docker-release: