diff --git a/src/.vuepress/config.ts b/src/.vuepress/config.ts index a73847ba3..2b0fb6a3a 100644 --- a/src/.vuepress/config.ts +++ b/src/.vuepress/config.ts @@ -34,7 +34,7 @@ export default defineUserConfig({ scopeName: "source.webgal", path: path.resolve(__dirname, "../grammar/webgal.tmLanguage.json"), }, - "ts", "bash", "json", "xml", "kotlin", + "ts", "bash", "json", "xml", "kotlin", "yaml" ], }), diff --git a/src/en/publish/web/readme.md b/src/en/publish/web/readme.md index 9e041387a..51bacb54d 100644 --- a/src/en/publish/web/readme.md +++ b/src/en/publish/web/readme.md @@ -4,6 +4,55 @@ Select Export to Web in the upper right corner of the editor. The deployment method of the web page is the same as that of deploying a normal website. You can purchase cloud servers (Tencent Cloud, Alibaba Cloud) for deployment or use GitHub Pages. +### GitHub Pages + +1. Create a repository on GitHub and clone it to your local machine. + +2. `Copy all` the exported project source files to the root directory of the cloned repository. + +3. In the `.github/workflows` directory of the cloned repository, create a file named `deploy.yml`, and its content should be as follows: +```yaml +name: WebGal Web Deploy to GitHub Pages + +on: + push: + branches: + - main # The workflow is triggered when pushed to the main branch + workflow_dispatch: # Allows manual triggering of the workflow + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./ # You can also customize the file upload path (if you change the path) + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 +``` + +4. In your repository's **Settings**, go to the **Pages** section. Under **Build and deployment**, set the **Source** to **GitHub Actions**. + +5. Push the code to the `main` branch and wait for the `GitHub Action` to complete. You should see the site deployed to `https://.github.io/[repository]/` or `https:///`, depending on your settings. From then on, the deployment will be automatically triggered every time you push to the `main` branch. + ## If you use **Release Version** Copy the files under /WebGAL (not the folder, the files under the /WebGAL folder) to the specified directory of the cloud server you want to deploy, or deploy to GitHub Pages. diff --git a/src/ja/publish/web/readme.md b/src/ja/publish/web/readme.md index 1841b8d29..9d4b3b333 100644 --- a/src/ja/publish/web/readme.md +++ b/src/ja/publish/web/readme.md @@ -4,6 +4,55 @@ エディタの右上にある「Web にエクスポート」を選択します。Web のデプロイ方法は、通常の Web サイトをデプロイする方法と変わりません。クラウドサーバー(Tencent Cloud、Alibaba Cloud など)を購入してデプロイするか、GitHub Pages を使用することができます。 +### GitHub Pages + +1. GitHub上にリポジトリを作成し、そのリポジトリをローカルに複製します。 + +2.エクスポートしたソースファイルをクローンリポジトリのルートディレクトリに`すべてコピーします`。 + +3.クローンリポジトリの`.github/workflows`ディレクトリに`deploy.yml`というファイルを作成します。 +```yaml +name: WebGal Web Deploy to GitHub Pages + +on: + push: + branches: + - main # ワークフローは、mainブランチにプッシュされるとトリガされます。 + workflow_dispatch: # 手動でワークフローをトリガーできるようにしました + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./ # アップロードするファイルのパスをカスタマイズすることもできます(パスを変更した場合)。 + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 +``` + +4. 作成したリポジトリの `Pages` メニューから`Build and deployment > Source > GitHub Actions`を選択します。 + +5. `main` ブランチにプッシュして `GitHub Action` が完了するまで待ちます。サイトは`https://.github.io/[repository]/`または`https:///`に配置されています。設定によります。以後、`main`ブランチにプッシュされるたびに自動的に配置されます。 + ## **リリース版** を使用している場合 /WebGAL の下にあるファイル(フォルダではなく、/WebGAL フォルダの下にあるファイル)を、デプロイしたいクラウドサーバーの指定されたディレクトリにコピーするか、GitHub Pages にデプロイします。 diff --git a/src/publish/web/readme.md b/src/publish/web/readme.md index 825ff01ee..95416b528 100644 --- a/src/publish/web/readme.md +++ b/src/publish/web/readme.md @@ -4,6 +4,56 @@ 在编辑器右上角选择导出为网页。网页的部署方式,与部署一个正常网站的方式无异。你可以购买云服务器(腾讯云、阿里云)等部署或使用 GitHub Pages。 +### GitHub Pages + +1. 在 GitHub 上创建一个仓库,将仓库克隆到本地。 + +2. 将导出的项目源文件`全部复制`到克隆仓库的根目录下。 + +3. 在克隆仓库的 `.github/workflows` 目录中创建一个名为 `deploy.yml` 的文件,它的内容应该如下: +```yaml +name: WebGal Web Deploy to GitHub Pages + +on: + push: + branches: + - main # 当推送到 main 分支时触发工作流 + workflow_dispatch: # 允许手动触发工作流 + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./ # 你也可以自定义上传的文件路径(如果你更改了路径的话) + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 +``` + +4. 在你创建的仓库存储库设置中的`Pages`菜单项下,选择`Build and deployment > Source > GitHub Actions`,这样它将开启 `GitHub Actions` + +5. 推送到 `main` 分支并等待 `GitHub Action` 完成。你应该看到站点部署到 `https://.github.io/[repository]/` 或 `https:///`,这取决于你的设置。此后每次推送到 `main` 分支时自动部署。 + + ## 如果你使用**发行版** 复制/WebGAL 下的文件(不是文件夹,是/WebGAL 文件夹下的文件)到你想要部署的云服务器的指定目录下,或是部署到 GitHub Pages。