Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
IainYa committed Sep 1, 2024
2 parents 23f7dfe + 10715cb commit 04d4081
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:
pull_request:

jobs:
book:
build_and_publish:
name: Build and Publish

runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
pull-requests: write

steps:
- name: Checkout
Expand All @@ -34,14 +36,21 @@ jobs:
run: mdbook build

- name: Publish to Cloudflare Pages
id: publish
uses: cloudflare/wrangler-action@v3
if: github.ref_name == 'main'
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: e532cde53d2aaf233bc8f913f31a325f
command: pages deploy book --project-name=ms-wiki-test

- name: TODO print deployment-url
env:
DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment-url }}
run: echo $DEPLOYMENT_URL
- name: Add preview comment to Pull Request
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '✨ you may preview these changes at <${{ steps.publish.outputs.deployment-url }}>'
})
3 changes: 3 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ language = "en"
multilingual = false

src = "src"

[output.html.fold]
enable = true

0 comments on commit 04d4081

Please sign in to comment.