Skip to content

Latest commit

 

History

History
56 lines (47 loc) · 2.9 KB

ACTION.md

File metadata and controls

56 lines (47 loc) · 2.9 KB

Github Action Auto-update Process

1. Complete one deployment manually

Refer to Deployment Process for specific deployment steps.

2. Fork this repository

3. Create Cloudflare API TOKEN

To create a Cloudflare API Token with Workers permissions, follow these steps:

  1. Log in to your Cloudflare account and navigate to the "My Profile" page.
  2. Select "API Tokens" from the left-hand menu.
  3. Click the "Create Token" button.
  4. Choose "Edit Cloudflare Workers" from the API token templates.

image

6. In the "Zone Resources" dropdown menu, select the zone you want to authorize. 7. In the "Account Resources" dropdown menu, select the account you want to authorize.

image

8. Click the "Create Token" button. > You have now created a Cloudflare API Token with Workers permissions. Remember, API Token security is very important. Do not share it unnecessarily and change your API Token regularly.

4. Set up Secrets for Actions

image

  1. Add the following Secrets to the Github repository's Settings -> Secrets
    • CF_API_TOKEN: Your Cloudflare API TOKEN
    • WRANGLER_TOML: The full content of the wrangler.toml file. Refer to wrangler-example.toml for an example.
    • CF_WORKERS_DOMAIN (optional): Your Cloudflare Workers route (the value of your *.workers.dev in the Workers route, without https://)
  2. Enable Actions in the Github repository's Settings -> Actions

4. Synchronize my repository

  1. For security reasons, the repository you forked will not automatically sync with my repository. Therefore, you need to manually sync with my repository.
  2. When you manually sync with my repository, your repository will automatically trigger the Action and deploy automatically.
  3. If you want to skip this step, you can add an Action to automatically sync with my repository.
    1. Create a file in your repository named: .github/workflows/sync.yml
    2. Copy the following content to the file.
    3. The code below has not been tested and is for reference only.
    name: Sync
    on:
      schedule:
        - cron: '0 0 * * *'
    jobs:
        sync:
            runs-on: ubuntu-latest
            steps:
            - name: Sync
                uses: repo-sync/github-sync@v2
                with:
                source_repo: 'https://github.com/TBXark/ChatGPT-Telegram-Workers'
                target_repo: 'Fill in your repository address'
                github_token: ${{ secrets.GITHUB_TOKEN }} 
                source_branch: 'master'