Skip to content

Commit

Permalink
Merge pull request #34 from illacloud/CI/update_host
Browse files Browse the repository at this point in the history
feat: add github page
  • Loading branch information
AruSeito authored Jan 3, 2024
2 parents 6753faf + fb0db5d commit 5a83284
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 3 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/deploy-to-gh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main
- develop

permissions:
contents: write

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
env:
ILLA_URL: "https://illacloud.github.io"
ILLA_BASE_URL: "/illa-website/"

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18

- name: Install Crowdin CLI
run: npm i -g @crowdin/cli

- name: Check Crowdin
run: crowdin -V

- uses: pnpm/action-setup@v2
with:
version: 8.7.0

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Write translations
run: pnpm run write-translations

- name: Upload translations
run: crowdin upload

- name: Download translations
run: crowdin download

- name: Build website
run: pnpm build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./build
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:

jobs:
deploy:
name: Deploy to GitHub Pages
name: Deploy to k8s
runs-on: ubuntu-latest
environment:
name:
Expand All @@ -27,6 +27,7 @@ jobs:
'beta' }}
env:
ILLA_APP_ENV: ${{ vars.ILLA_APP_ENV }}
ILLA_URL: "https://illacloud.com"

steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 4 additions & 2 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ const config: Config = {
favicon: "img/public/favicon.ico",

// Set the production url of your site here
url: "https://illa.cloud",
url: process.env.ILLA_URL,
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/",
baseUrl: process.env.ILLA_BASE_URL?process.env.ILLA_BASE_URL:"/",
organizationName: process.env.ILLA_BASE_URL?"illacloud":"", // Usually your GitHub org/user name.
projectName: process.env.ILLA_BASE_URL?"illa-website":"", // Usually your repo name.
staticDirectories: ["public", "static"],

onBrokenLinks: "warn",
Expand Down

0 comments on commit 5a83284

Please sign in to comment.