diff --git a/.asf.yaml b/.asf.yaml index 7f6f7bc1..9cc61173 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -41,15 +41,25 @@ github: required_pull_request_reviews: required_approving_review_count: 1 -# publishes the content of the `asf-site` branch to +# Publishes the content of the `asf-site` branch to # https://datafusion.apache.org/blog publish: whoami: asf-site subdir: blog -# Publishes the content of `asf-staging` branch to -# http://datafusion.staged.apache.org +# Automatically builds branches matching `site/*` +# and pushes the output to `site/-staging`. +# For example, `site/foo` → `site/foo-staging` +pelican: + whoami: ~ + autobuild: site/* + +# Automatically stages the output of autobuild branches. +# For example: +# - A push to `site/foo` triggers an autobuild to `site/foo-staging` +# - `site/foo-staging` matches the `autostage` pattern +# - The site is then staged at: https://datafusion-foo.staged.apache.org staging: - whoami: asf-staging - profile: ~ + whoami: ~ + subdir: blog autostage: site/* diff --git a/.github/workflows/stage-site.yml b/.github/workflows/stage-site.yml deleted file mode 100644 index 52b37d6a..00000000 --- a/.github/workflows/stage-site.yml +++ /dev/null @@ -1,24 +0,0 @@ -# This workflow will create a staged version of the website. The last branch for which this workflow -# was run will be published to https://datafusion.staged.apache.org/ -# To enable this work flow, you simply need a PR that has a branch name that begins with `site/` -# and targets `main`. This workflow will build the site and push the results into the branch -# `asf-staging`. From there, the ASF infrastructure will identify that a stage site has been -# built and will publish to the link above. - -name: Stage Site -on: - pull_request: - branches: ["main"] -jobs: - build-pelican: - if: startsWith(github.head_ref, 'site/') - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v4 - - run: pip install MarkupSafe==2.0.1 - - uses: apache/infrastructure-actions/pelican@main - with: - destination: 'asf-staging' - gfm: 'false' - output: 'blog' diff --git a/README.md b/README.md index 395d47ba..f1b36883 100644 --- a/README.md +++ b/README.md @@ -14,34 +14,43 @@ There are a couple of important impacts on the publishing: ## Testing -There are two ways to preview your blog post before publishing the site. You can -either locally build and test the site or you can use the auto staging feature -of the CI system. To locally build the site on your machine, follow the instructions below. +There are two ways to preview your blog post before publishing it: -To use the staging feature of the CI system, push a branch that starts with -`site/` and create a PR to merge this branch into `main`. When you do so, it -will trigger a CI process that will build the site and push it to the branch -`asf-staging`. Once this completes, the ASF infrastructure will auto publish -this staged branch to https://datafusion.staged.apache.org/ It is important -to note that this staging feature only works for branches on the main repo. -If you are working on a forked repo, you will need to use the local approach -below. +1. **Local preview** - Build and test the site on your own machine. +2. **CI auto-staging** - Use the ASF CI system to automatically build and stage the site for preview. -The most recently run staging CI pipeline will be published to this site. If you -need to republish any branch, simply rerun the `Stage Site` workflow. +### Local Preview -## Local Setup +To locally build and preview the site on your computer: -To locally build and preview the site on your computer, run ```shell make ``` This will build the site using the [`ASF-Pelican`](https://github.com/apache/infrastructure-actions/tree/main/pelican) docker container. -Navigate in your web browser to [http://localhost:8000/blog](http://localhost:8000/blog) to view the live -website. In your terminal you can press Ctrl+C and rerun the last two commands -to rebuild and publish the site. +Once the site is built, open your browser and navigate to: +[http://localhost:8000/blog](http://localhost:8000/blog) + +You'll see a live preview of the site. If you make changes, stop the server with `Ctrl+C` and rerun `make` to rebuild and preview again. + +### CI Auto-Staging + +To use the auto-staging feature, push your changes to a branch that starts with `site/` (e.g., `site/my-post`). + +This will trigger the CI system to: + +1. Build the site from your `site/*` branch. +2. Output the result to a branch named `site/-staging`. +3. Push that staging branch to the main repository. +4. ASF infrastructure will then publish the content to: +`https://datafusion-.staged.apache.org` + +For example, pushing `site/blog-redesign` will result in: +https://datafusion-blog-redesign.staged.apache.org + +Note that CI auto-staging only works on branches in the main `apache` repository. +If you're working in a fork, use the local preview method instead. ## Publish site @@ -49,11 +58,7 @@ The site publishes using a GitHub action provided by the ASF Infrastructure team See the [ASF-Pelican](https://infra.apache.org/asf-pelican.html) site for most details on how this process works. -To preview your site live, create a branch named `site/my-feature-x`. This should -auto-publish to https://datafusion.staged.apache.org/ - -When you are satisfied with the staged branch, merging into `main` should cause -the site to build via github actions and publish. +Merging into `main` should cause the site to build via github actions and publish. #### Check site status