update cocomanhua keys #266
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: update cocomanhua keys | |
on: | |
schedule: | |
- cron: '0 0/8 * * *' | |
workflow_dispatch: | |
jobs: | |
updateKeys: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: main | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.local/lib/python3.8/site-packages | |
./node_modules | |
~/.cache/puppeteer | |
key: ${{ runner.os }}-autoCI-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-autoCI-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/package.json') }} | |
- name: install Dependences | |
run: | | |
npm install | |
# pip install -r requirements.txt | |
- name: extra keys | |
run: | | |
source $GITHUB_WORKSPACE/coco/coco.sh | |
main | |
- name: push changes to test branch | |
run: | | |
mkdir test | |
mv coco_keys.json ./test | |
cd test | |
git init -b test | |
git add . | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git commit -m "update cocomanhua keys at $(date "+%Y/%m/%d %H:%M")" | |
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" | |
git push -f -u origin test | |
- name: Delete workflow runs | |
uses: Mattraks/delete-workflow-runs@v2 | |
with: | |
token: ${{ github.token }} | |
repository: ${{ github.repository }} | |
retain_days: 2 | |
keep_minimum_runs: 6 |