From a27541b829b3836290a3dcad9b51230f284a0e3e Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Mon, 23 Dec 2024 18:19:54 +0100 Subject: [PATCH] ci: enhance GitHub Pages deployment process in CircleCI config --- .circleci/config.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4083677a98..44ef8b6332 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,6 +3,7 @@ version: 2.1 orbs: gcp-cli: circleci/gcp-cli@3.0.1 slack: circleci/slack@4.10.1 + utils: ethereum-optimism/circleci-utils@0.0.7 parameters: go_version: @@ -88,7 +89,27 @@ jobs: - run: name: Deploy to GitHub Pages command: | - echo "here we would deploy" + 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 + + # Clean existing files (equivalent to clean: true) + git rm -rf . + + # Copy new files + cp -a tmp/pages/. . + + # Commit and push + git add . + git commit -m "Deploy to GitHub Pages [skip ci]" + # git push origin ${pages_branch} --force docker-release: environment: