Skip to content

Commit

Permalink
Move to subdir (#51)
Browse files Browse the repository at this point in the history
* Test site url

* Disable use_directory_urls

* Test

* Test

* Redirect

* Custom vercel.json

* Fix redirect

* Test

* Disable site_url

* Update CI

* Clean site url

* Update site url
  • Loading branch information
fewensa authored Sep 4, 2024
1 parent fa5acc8 commit c4cad12
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 26 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
dist_path: site
alias_domain: "msgport-docs-dev"
script_run: false
vercel_json_path: docs/vercel.json
enable_cache: true
enable_notify_comment: true
enable_notify_slack: true
Expand Down
45 changes: 21 additions & 24 deletions .github/workflows/deploy-prd.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
name: Deploy production with GitHub Pages
name: Deploy production

on:
push:
tags:
- "v*"

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Fetch latest code
Expand All @@ -37,12 +23,23 @@ jobs:
pip3 install poetry
poetry run poetry install --no-root
poetry run mkdocs build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
- name: Setup Vercel environment
uses: actions/checkout@v4
with:
repository: darwinia-network/devops
path: .github
- name: Deploy to Vercel
uses: ./.github/actions/smart-vercel
with:
path: "site"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
preview_output: true
project_name: msgport-docs
prod_mode: true
dist_path: site
script_run: false
vercel_json_path: docs/vercel.json
enable_cache: true
enable_notify_slack: true
slack_channel: darwinia-docs
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion .github/workflows/deploy-stg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
path: .github
- name: Deploy to Vercel
uses: ./.github/actions/smart-vercel
id: smart-vercel
with:
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
Expand All @@ -38,6 +37,7 @@ jobs:
dist_path: site
alias_domain: "msgport-docs-stg"
script_run: false
vercel_json_path: docs/vercel.json
enable_cache: true
enable_notify_slack: true
slack_channel: darwinia-docs
Expand Down
10 changes: 10 additions & 0 deletions docs/vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"trailingSlash": true,
"redirects": [
{
"source": "/:path((?!docs).*)",
"destination": "/docs/:path*",
"permanent": true
}
]
}
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
site_name: Msgport Documentation
site_url: https://docs.msgport.xyz/
site_url: https://msgport.ringdao.com/docs/
site_description: "This is the official documentation for the Msgport, which is a programmable cross-chain messaging protocol. This site covers the design, usage and integration guide for Msgport."
copyright: Copyright © Msgport
repo_name: msgport-docs
edit_uri: https://github.com/msgport/docs/edit/main/docs
use_directory_urls: false
site_dir: site/docs
theme:
name: material
logo: resource/pics/msgport-logo.svg
Expand Down

0 comments on commit c4cad12

Please sign in to comment.