Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
tags: ['v*.*.*']
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
paths: ['.github/scripts/**','.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cc', '**/*.cxx', '!docs/**', '!.gitignore']
pull_request:
types: [opened, synchronize, reopened]
Expand Down
29 changes: 26 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- main
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
tags: ["v[0-9]+.[0-9]+.[0-9]+-docs"]
pull_request:
branches:
- main
Expand All @@ -18,6 +20,9 @@ on:
jobs:
deploy:
name: Deploy to GitHub Pages
env:
CLOUDFLARE_ACCOUNT_ID: 9707100ef42a1a25bd70e3ee2137bd0e
CLOUDFLARE_PROJECT_NAME: nitro
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -50,15 +55,33 @@ jobs:
- name: Build website
run: sed -i '/process.env.DEBUG = namespaces;/c\// process.env.DEBUG = namespaces;' ./node_modules/debug/src/node.js && yarn build
working-directory: docs


- name: Publish to Cloudflare Pages PR Preview and Staging
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main')
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ env.CLOUDFLARE_PROJECT_NAME }}
directory: ./docs/build
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
id: deployCloudflarePages

- uses: mshick/add-pr-comment@v2
if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main'
with:
message: |
Preview URL: ${{ steps.deployCloudflarePages.outputs.url }}

- name: Add Custome Domain file
if: github.event_name == 'push' && github.event.pull_request.head.repo.full_name != github.repository
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: echo "${{ vars.DOCUSAURUS_DOMAIN }}" > ./docs/build/CNAME

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.event.pull_request.head.repo.full_name != github.repository
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down