From b1a507694b98f2ebd00d046af64d6714c8c99842 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Mon, 25 Sep 2023 16:10:42 +0800 Subject: [PATCH] chore: update GitHub Actions workflow file - Rename `.github/workflows/ci.yml` to `.github/workflows/main.yml` - Change the name of the workflow from "test" to "CI" - Add instructions for creating a `.github/workflows/main.yml` file - Add example content for the `main.yml` file Signed-off-by: Bo-Yi Wu --- .github/workflows/{ci.yml => main.yml} | 2 +- README.md | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) rename .github/workflows/{ci.yml => main.yml} (94%) diff --git a/.github/workflows/ci.yml b/.github/workflows/main.yml similarity index 94% rename from .github/workflows/ci.yml rename to .github/workflows/main.yml index 7750338..28e41ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: test +name: CI on: [push] jobs: build: diff --git a/README.md b/README.md index 828711c..6eab6c9 100644 --- a/README.md +++ b/README.md @@ -122,3 +122,29 @@ services: 請將 `` 替換成你的 Gitea 服務網址,`` 替換成你的 Runner Token。啟動後可以在後台看到底下畫面 ![gitea runner list](./images/gitea-runner-list.png) + +## 撰寫 Gitea Actions + +請建立 `.github/workflows` 資料夾,並建立 `main.yml` 檔案 + +```bash +mkdir -p .github/workflows +``` + +打開 `main.yml` 檔案,輸入以下內容: + +```yaml +name: CI +on: [push] +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: echo hello world + run: | + echo "hello world" +``` + +請將 `echo hello world` 替換成你想要執行的指令,例如 `npm install` 或 `npm test`。