Skip to content

add: separate dns from service #115

add: separate dns from service

add: separate dns from service #115

Workflow file for this run

name: Generator
on:
push:
branches:
- main
paths:
- '.github/workflows/generator.yml'
- 'script/generator.py'
- 'as/**'
concurrency:
group: generator
cancel-in-progress: true
jobs:
generator:
runs-on: ubuntu-latest
name: Generator
steps:
- name: Setup Python Environment
uses: actions/setup-python@main
with:
python-version: "3.10"
- name: Checkout Code
uses: actions/checkout@main
with:
token: ${{ secrets.GH_TOKEN }}
- name: Get Old Zone File
uses: actions/checkout@main
with:
token: ${{ secrets.GH_TOKEN }}
repository: hdu-dn11/metadata
path: metadata.old
sparse-checkout: |
dn11.zone
sparse-checkout-cone-mode: false
- name: Run Generator
run: |
pip3 install pyyaml IPy py-markdown-table requests
python3 script/generator.py
- name: Upload Metadata to GitHub
run: |
cd metadata
mv monitor-metadata.json ..
git init
git config --global user.name "GitHub Action"
git config --global user.email "action@github.com"
git add *
git commit -m "Sync"
git branch -M main
git remote add origin https://${{ secrets.GH_TOKEN }}@github.com/hdu-dn11/metadata.git
git push --force -u origin main
- name: Prepare for COS Upload
run: |
cd metadata
rm -rf .git README.md
mv ../monitor-metadata.json .
- name: Upload Monitor-Metadata to COS
timeout-minutes: 5
uses: TencentCloud/cos-action@v1
with:
secret_id: ${{ secrets.TENCENT_CLOUD_SECRET_ID }}
secret_key: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }}
cos_bucket: ${{ secrets.COS_BUCKET }}
cos_region: ${{ secrets.COS_REGION }}
local_path: 'metadata'
remote_path: ''
clean: false