-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
e7836f3
commit b917363
Showing
262 changed files
with
1,069,585 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Hexo Seo Submit | ||
on: | ||
schedule: | ||
- cron: 0 4 * * * | ||
push: | ||
branches: | ||
- master | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
- uses: actions/setup-node@main | ||
with: | ||
node-version: latest | ||
|
||
- name: check owner | ||
id: check_owner | ||
run: | | ||
OWNER_TYPE=$(jq -r '.repository.owner.type' "$GITHUB_EVENT_PATH") | ||
OWNER_ID=$(jq -r '.repository.owner.id' "$GITHUB_EVENT_PATH") | ||
SENDER_ID=$(jq -r '.sender.id' "$GITHUB_EVENT_PATH") | ||
if [ "$OWNER_TYPE" = "User" ] && [ "$OWNER_ID" -eq "$SENDER_ID" ]; then | ||
echo "is_owner=true" >> $GITHUB_ENV | ||
elif [ "$OWNER_TYPE" = "Organization" ]; then | ||
echo "is_owner=true" >> $GITHUB_ENV | ||
else | ||
echo "is_owner=false" >> $GITHUB_ENV | ||
fi | ||
env: | ||
GITHUB_EVENT_PATH: ${{ github.event_path }} | ||
|
||
- run: | | ||
npm init -y | ||
npm install hexo-seo-submit | ||
- name: push search engine bing | ||
if: env.is_owner | ||
continue-on-error: true | ||
run: | | ||
npx hexo-seo-submit bing -k ${{ secrets.bing_apikey }} -f bing.json | ||
- name: push search engine google | ||
if: env.is_owner | ||
continue-on-error: true | ||
run: | | ||
npx hexo-seo-submit google -f google.txt -mail ${{ secrets.google_client_email }} -key "${{ secrets.google_private_key }}" |
Oops, something went wrong.