Asf staged preview debugging #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
# 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 | |
publish_branch: asf-site |