Skip to content

CI: Automated deployment of docs on GH Pages#1

Merged
tkstanczak merged 3 commits into
NethermindEth:mainfrom
HarshCasper:docs-deployment
Jan 26, 2022
Merged

CI: Automated deployment of docs on GH Pages#1
tkstanczak merged 3 commits into
NethermindEth:mainfrom
HarshCasper:docs-deployment

Conversation

@HarshCasper

Copy link
Copy Markdown
Contributor

Description

This PR:

  • Builds the docs on every PR
  • Pushes the build directory on gh-pages branch on every push

Note

Before merging this PR, an orphan gh-pages branch should be configured. To create the orphan gh-pages branch:

git checkout --orphan gh-pages
git reset --hard
git commit --allow-empty -m "Initializing gh-pages branch"
git push origin gh-pages
git checkout main

Once the branch is pushed to GitHub, you have to go to the Settings page of the repository. In the section “GitHub Pages”, select gh-pages as the source. We can merge the PR then and allow it to build and push the website.

In case the deployment fails, we might also need to configure the Branch Protection Rule. We need to have Allow force pushes to permit force pushes for all users with push access.

@tkstanczak

Copy link
Copy Markdown
Member

Great.
Is it possible to have a similar staging / main setup like describer in contribution steps here?
https://github.com/flashbots/docs/blob/staging/docs/contribution-guide.mdx

@HarshCasper

Copy link
Copy Markdown
Contributor Author

Great. Is it possible to have a similar staging / main setup like describer in contribution steps here? https://github.com/flashbots/docs/blob/staging/docs/contribution-guide.mdx

Hi @tkstanczak 👋

This is quite doable! I am writing a CI workflow to do this using Surge, based on the Publish to surge.sh workflow. This pipelines runs only on workflow runs for now, but I will tweak it to run on PRs as well.

I would request you to generate a Surge token. Please install the Surge CLI and generate a token by running surge token and add it in GitHub Secrets as SURGE_TOKEN.

I will make a commit now for this to happen :)

@tkstanczak tkstanczak merged commit 76c597a into NethermindEth:main Jan 26, 2022
@HarshCasper HarshCasper deleted the docs-deployment branch January 26, 2022 14:22
stdevMac pushed a commit that referenced this pull request Feb 9, 2022
* CI: Automated deployment of docs on GH Pages

* FIX: Fix broken build on GHA

* CI: Publish PR previews on Surge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants