-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
349 additions
and
279 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,46 +2,46 @@ name: Baidu Sitemap Push | |
|
||
on: | ||
schedule: | ||
- cron: '0 16 * * *' | ||
- cron: "0 16 * * *" | ||
workflow_dispatch: | ||
inputs: | ||
name: | ||
description: '手动触发推送' | ||
description: "手动触发推送" | ||
required: false | ||
|
||
jobs: | ||
build: | ||
name: Baidu Sitemap Push | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
|
||
- name: Set Up Python | ||
uses: actions/setup-python@main | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install Requests | ||
run: pip install requests | ||
|
||
- name: Generate Txt | ||
run: python generate.py | ||
|
||
- name: Baidu Push | ||
run: curl -H 'Content-Type:text/plain' --data-binary @urls.txt "${{ secrets.BAIDU_TOKEN }}" | ||
|
||
- name: Delete Workflow Runs | ||
uses: Mattraks/delete-workflow-runs@main | ||
with: | ||
retain_days: 1 | ||
keep_minimum_runs: 1 | ||
|
||
- name: Telegram Notification | ||
if: cancelled() == false | ||
uses: xinthink/[email protected] | ||
with: | ||
botToken: ${{ secrets.TG_BOT_TOKEN }} #use bot @BotFather | ||
chatId: ${{ secrets.TG_CHAT_ID }} #use bot @userinfobot | ||
jobStatus: ${{ job.status }} | ||
skipSuccess: true | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
|
||
- name: Set Up Python | ||
uses: actions/setup-python@main | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install Requests | ||
run: pip install requests | ||
|
||
- name: Generate Txt | ||
run: python generate.py | ||
|
||
- name: Baidu Push | ||
run: curl -H 'Content-Type:text/plain' --data-binary @urls.txt "${{ secrets.BAIDU_TOKEN }}" | ||
|
||
- name: Delete Workflow Runs | ||
uses: Mattraks/delete-workflow-runs@main | ||
with: | ||
retain_days: 1 | ||
keep_minimum_runs: 1 | ||
|
||
- name: Telegram Notification | ||
if: cancelled() == false | ||
uses: xinthink/[email protected] | ||
with: | ||
botToken: ${{ secrets.TG_BOT_TOKEN }} #use bot @BotFather | ||
chatId: ${{ secrets.TG_CHAT_ID }} #use bot @userinfobot | ||
jobStatus: ${{ job.status }} | ||
skipSuccess: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,67 +14,67 @@ jobs: | |
YUQUE_TOKEN: ${{ secrets.YUQUE_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
with: | ||
ref: master | ||
fetch-depth: 0 | ||
- name: Checkout | ||
uses: actions/checkout@main | ||
with: | ||
ref: master | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@main | ||
with: | ||
node-version: "latest" | ||
check-latest: true | ||
cache: 'npm' | ||
cache-dependency-path: '**/package-lock.json' | ||
- name: Setup Node | ||
uses: actions/setup-node@main | ||
with: | ||
node-version: "latest" | ||
check-latest: true | ||
cache: "npm" | ||
cache-dependency-path: "**/package-lock.json" | ||
|
||
- name: Catch | ||
uses: actions/cache@main | ||
id: cache-dependencies | ||
with: | ||
path: node_modules | ||
key: ${{runner.OS}}-${{hashFiles('**/package-lock.json')}} | ||
- name: Catch | ||
uses: actions/cache@main | ||
id: cache-dependencies | ||
with: | ||
path: node_modules | ||
key: ${{runner.OS}}-${{hashFiles('**/package-lock.json')}} | ||
|
||
- name: Install Dependencies | ||
if: steps.cache-dependencies.outputs.cache-hit != 'true' | ||
run: | | ||
npm install | ||
- name: Install Dependencies | ||
if: steps.cache-dependencies.outputs.cache-hit != 'true' | ||
run: | | ||
npm install | ||
- name: Generate | ||
run: | | ||
git clone -b posts [email protected]:ccknbc-actions/blog-butterfly.git source/_posts | ||
npm run github | ||
- name: Generate | ||
run: | | ||
git clone -b posts [email protected]:ccknbc-actions/blog-butterfly.git source/_posts | ||
npm run github | ||
- name: Deploy Hexo Public To Pages | ||
run: | | ||
cd ./public | ||
git config --global init.defaultBranch master | ||
git config --global http.postBuffer 524288000 | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git init | ||
git add -A | ||
git branch -m master | ||
git commit -m "${{ github.event.head_commit.message }} $(date +"%Z %Y-%m-%d %A %H:%M:%S") Updated By GitHub Actions" | ||
git push --force --quiet "https://ccknbc:${{ secrets.GH_TOKEN }}@github.com/CCKNBC/ccknbc.github.io.git" master:master | ||
git push --force --quiet "https://ccknbc:${{ secrets.BB_TOKEN }}@bitbucket.org/ccknbc/ccknbc.bitbucket.io.git" master:master | ||
git push --force --quiet "https://${{ secrets.CD_USER }}:${{ secrets.CD_TOKEN }}@e.coding.net/ccknbc/blog/butterfly.git" master:master | ||
git push --force --quiet "https://ccknbc:${{ secrets.GT_TOKEN }}@gitee.com/ccknbc/ccknbc.git" master:master | ||
- name: Deploy Hexo Public To Pages | ||
run: | | ||
cd ./public | ||
git config --global init.defaultBranch master | ||
git config --global http.postBuffer 524288000 | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git init | ||
git add -A | ||
git branch -m master | ||
git commit -m "${{ github.event.head_commit.message }} $(date +"%Z %Y-%m-%d %A %H:%M:%S") Updated By GitHub Actions" | ||
git push --force --quiet "https://ccknbc:${{ secrets.GH_TOKEN }}@github.com/CCKNBC/ccknbc.github.io.git" master:master | ||
git push --force --quiet "https://ccknbc:${{ secrets.BB_TOKEN }}@bitbucket.org/ccknbc/ccknbc.bitbucket.io.git" master:master | ||
git push --force --quiet "https://${{ secrets.CD_USER }}:${{ secrets.CD_TOKEN }}@e.coding.net/ccknbc/blog/butterfly.git" master:master | ||
git push --force --quiet "https://ccknbc:${{ secrets.GT_TOKEN }}@gitee.com/ccknbc/ccknbc.git" master:master | ||
- name: Update Gitee Pages | ||
uses: yanglbme/gitee-pages-action@main | ||
with: | ||
- name: Update Gitee Pages | ||
uses: yanglbme/gitee-pages-action@main | ||
with: | ||
gitee-username: ccknbc | ||
gitee-password: ${{ secrets.GITEE_PASSWORD }} | ||
gitee-repo: ccknbc/ccknbc | ||
|
||
# - name: Sync RSS | ||
# run: | | ||
# curl 'https://kkapi.ccknbc.vercel.app/api/open/github/dispatch&owner=ccknbc-actions&repo=home&token=${{ secrets.GH_TOKEN }}&runit_text=RSS' | ||
# curl -X POST -F token=${{ secrets.GITLAB_TRIGGER_TOKEN }} -F ref=master https://gitlab.com/api/v4/projects/22130436/trigger/pipeline | ||
# - name: Sync RSS | ||
# run: | | ||
# curl 'https://kkapi.ccknbc.vercel.app/api/open/github/dispatch&owner=ccknbc-actions&repo=home&token=${{ secrets.GH_TOKEN }}&runit_text=RSS' | ||
# curl -X POST -F token=${{ secrets.GITLAB_TRIGGER_TOKEN }} -F ref=master https://gitlab.com/api/v4/projects/22130436/trigger/pipeline | ||
|
||
- name: Delete Workflow Runs | ||
uses: Mattraks/delete-workflow-runs@main | ||
with: | ||
retain_days: 1 | ||
keep_minimum_runs: 1 | ||
- name: Delete Workflow Runs | ||
uses: Mattraks/delete-workflow-runs@main | ||
with: | ||
retain_days: 1 | ||
keep_minimum_runs: 1 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ pages: | |
- yuque | ||
key: project | ||
only: | ||
- master | ||
- master |
Oops, something went wrong.