diff --git a/.github/workflows/deploy-to-gh.yml b/.github/workflows/deploy-to-gh.yml new file mode 100644 index 0000000000..401927a6e7 --- /dev/null +++ b/.github/workflows/deploy-to-gh.yml @@ -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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy-to-k8s.yml similarity index 97% rename from .github/workflows/deploy.yml rename to .github/workflows/deploy-to-k8s.yml index 1770f23fff..5a8de53f36 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy-to-k8s.yml @@ -18,7 +18,7 @@ env: jobs: deploy: - name: Deploy to GitHub Pages + name: Deploy to k8s runs-on: ubuntu-latest environment: name: @@ -27,6 +27,7 @@ jobs: 'beta' }} env: ILLA_APP_ENV: ${{ vars.ILLA_APP_ENV }} + ILLA_URL: "https://illacloud.com" steps: - uses: actions/checkout@v3 diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 1cda81ddf3..81ca365623 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -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 // pathname under which your site is served // For GitHub pages deployment, it is often '//' - 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",