Skip to content

Commit a4aa26d

Browse files
authored
Merge branch 'main' into chore/update-package-docs
2 parents 7f07395 + 0dd7082 commit a4aa26d

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

.github/workflows/jan-docs.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- main
77
paths:
88
- 'docs/**'
9+
tags: ["v[0-9]+.[0-9]+.[0-9]+-docs"]
910
pull_request:
1011
branches:
1112
- main
@@ -18,7 +19,14 @@ on:
1819
jobs:
1920
deploy:
2021
name: Deploy to GitHub Pages
22+
env:
23+
CLOUDFLARE_ACCOUNT_ID: 9707100ef42a1a25bd70e3ee2137bd0e
24+
CLOUDFLARE_PROJECT_NAME: jan
2125
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
28+
deployments: write
29+
pull-requests: write
2230
steps:
2331
- uses: actions/checkout@v3
2432
- uses: actions/setup-node@v3
@@ -50,15 +58,33 @@ jobs:
5058
- name: Build website
5159
run: sed -i '/process.env.DEBUG = namespaces;/c\// process.env.DEBUG = namespaces;' ./node_modules/debug/src/node.js && yarn build
5260
working-directory: docs
53-
61+
62+
- name: Publish to Cloudflare Pages PR Preview and Staging
63+
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main')
64+
uses: cloudflare/pages-action@v1
65+
with:
66+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
67+
accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }}
68+
projectName: ${{ env.CLOUDFLARE_PROJECT_NAME }}
69+
directory: ./docs/build
70+
# Optional: Enable this if you want to have GitHub Deployments triggered
71+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
72+
id: deployCloudflarePages
73+
74+
- uses: mshick/add-pr-comment@v2
75+
if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main'
76+
with:
77+
message: |
78+
Preview URL: ${{ steps.deployCloudflarePages.outputs.url }}
79+
5480
- name: Add Custome Domain file
55-
if: github.event_name == 'push' && github.event.pull_request.head.repo.full_name != github.repository
81+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
5682
run: echo "${{ vars.DOCUSAURUS_DOMAIN }}" > ./docs/build/CNAME
5783

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

.github/workflows/jan-electron-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Jan Build Electron App
22

33
on:
44
push:
5-
tags: ["v*.*.*"]
5+
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
66

77
jobs:
88
build-macos:

0 commit comments

Comments
 (0)