Skip to content

Commit

Permalink
docs: add more detailed guide for users
Browse files Browse the repository at this point in the history
  • Loading branch information
rnmeow committed Mar 3, 2024
1 parent 8a5c5ff commit d2cb236
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,38 @@
## 使用

1. 新增一個 GitHub Actions 作業流程。

2. 添加 [`schedule`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule) 欄位,並設定定時執行。

3. 在 Marketplace 中選擇 [此 Action](https://github.com/marketplace/actions/quote-box-zh_tw)

4. 使用 [Deploy to Gist](https://github.com/marketplace/actions/deploy-to-gist) 並填入必要參數(`token``gist_id``file_path: quote.txt`)。

5. 成功!
你可以使用 GitHub Actions 作業流程來執行操作,以下為一個範例,使用 [Deploy to Gist](https://github.com/marketplace/actions/deploy-to-gist)

```yaml
name: Push to Gist

on:
push:
branches:
- master
schedule:
- cron: 0 0 * * * # 每天執行

jobs:
push:
runs-on: ubuntu-22.04
env:
FILE_NAME: 🌧 Quote
GIST_ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
steps:
- name: Download
uses: rnmeow/[email protected]
- name: Push
uses: exuanbo/[email protected]
with:
token: ${{ secrets.GH_TOKEN }} # 需要自行產生
gist_id: ${{ env.GIST_ID }} # 上述 `env` 設定
gist_file_name: ${{ env.FILE_NAME }} # 上述 `env` 設定
file_path: quote.txt
file_type: text

# Authored by Yu-huan Kuo, licensed under MIT License.
```

## 授權

Expand Down

0 comments on commit d2cb236

Please sign in to comment.