Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asf staged preview debugging #5

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ github:
rebase: true
protected_branches:
asf-site: {}
asf-staging: {}
main:
required_status_checks:
# strict means "Require branches to be up to date before merging".
Expand Down
70 changes: 28 additions & 42 deletions .github/workflows/publish-cloudberry-site.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,48 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# publish-cloudberry-site.yml
#
# This workflow builds and publishes the Apache Cloudberry website to
# cloudberry.apache.org.
# The site is built using Node.js and published to the asf-site branch,
# which Apache infrastructure then serves at cloudberry.apache.org
#
# Triggered by:
# - Push to main branch: Builds and publishes to asf-site
# - Pull requests: Builds only (no publish) to verify changes
#
# Requirements:
# - Node.js project with build script in package.json
# - .asf.yaml file in repository root
#
# Notes:
# - Publication only occurs on push events, not pull requests
# - The asf-site branch is protected - only this workflow should modify it
# - Build artifacts are placed in ./build directory

name: Publish Cloudberry Site

on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# Checkout the repository
- uses: actions/checkout@v4

# Set up Node.js environment
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- run: npm run build
- run: cp .asf.yaml build/.asf.yaml
- uses: peaceiris/actions-gh-pages@v3
if: github.event_name != 'pull_request'

# Install dependencies and build site
- name: Install dependencies
run: npm install

- name: Build site
run: npm run build

- name: Copy ASF config
run: cp .asf.yaml build/.asf.yaml

# Deploy to asf-staging for PR preview
- name: Deploy to staging
if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
publish_branch: asf-staging

# Deploy to asf-site for production
- name: Deploy to production
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
Expand Down
Loading