DailyTask #1571
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: DailyTask | |
on: | |
# push: | |
# branches: | |
# - main | |
# 东八区每天八点多运行 | |
schedule: | |
- cron: "0 0 * * *" | |
# 标星时运行 | |
# watch: | |
# types: [started] | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
type: boolean | |
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' | |
required: false | |
default: false | |
jobs: | |
autogreen: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v2 | |
with: | |
# 这里必须是0, gitee 不允许 shallow push | |
fetch-depth: 0 | |
ref: tasks | |
persist-credentials: false | |
- name: Setup PHP Action | |
uses: shivammathur/[email protected] | |
- name: My-Tasks | |
run: | | |
# 设置Git | |
if [ 'a${{ secrets.PUSH_EMAIL }}' != 'a' ]; then | |
git config --local user.name ${{ github.actor }} | |
git config --local user.email ${{ secrets.PUSH_EMAIL }} | |
else | |
git config --local user.name "github-actions[bot]" | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
fi | |
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
# https://github.com/mouday/wallpaper-database | |
# 获取必应壁纸 | |
cd ./Bing && php index.php && cd .. | |
# 记录log | |
date +"%Y-%m-%d %H:%M:%S.%N" >> Tasks.log | |
# 推送 | |
git add . | |
git commit -am "A commit a day keeps girlfriend away." | |
git push origin tasks | |
# gitee-ssh | |
if [ 'a${{ secrets.GITEE_RSA }}' != 'a' ]; then | |
mkdir ~/.ssh | |
echo 'StrictHostKeyChecking no | |
# gitee | |
Host gitee.com | |
HostName gitee.com | |
PreferredAuthentications publickey | |
IdentityFile ~/.ssh/Gitee_rsa' > ~/.ssh/config | |
echo '${{ secrets.GITEE_RSA }}' > ~/.ssh/Gitee_rsa | |
chmod 600 ~/.ssh/* | |
ssh -T [email protected] | |
git remote add Gitee [email protected]:${{ github.repository }}.git | |
git push Gitee tasks -f | |
fi | |
wakabox: | |
name: Update-wakabox-gist | |
runs-on: ubuntu-latest | |
env: | |
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }} | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
GIST_ID: 4f05baa3e214af5fb92660d3cb44c238 | |
GIST_BARSTYLE: SOLIDLT | |
GIST_BARLENGTH: -1 | |
GIST_TIMESTYLE: SHORT | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.18 | |
id: go | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
with: | |
repository: 'XiaoMiku01/waka-box-go' | |
# 设置 path 的话, checkout 之后需要 cd 切进去 | |
# path: 'waka-box-go' | |
- name: Update-gist | |
run: go run ./cmd/box/main.go | |
wakeup-and-checkssl: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: gh-pages | |
- name: wakeup & Build | |
run: | | |
curl ${{ secrets.URL }} | |
chmod +x checker.sh | |
./checker.sh ${{ secrets.URL }} | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
# external_repository: username/external-repository | |
# publish_branch: your-branch # default: gh-pages | |
publish_dir: . | |
# 如果不设置下面, 会以用户名义提交, 与上面的Auto-green重复 | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
mirror: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Mirror Weidows-projects | |
uses: Yikun/hub-mirror-action@master | |
with: | |
src: github/Weidows-projects | |
dst: gitee/weidows-projects | |
dst_key: ${{ secrets.GITEE_RSA }} | |
dst_token: ${{ secrets.GITEE_TOKEN }} | |
account_type: org | |
force_update: true | |
# white_list: | |
black_list: '.github' | |
# static_list: | |
- name: Mirror Hebau-Community | |
uses: Yikun/hub-mirror-action@master | |
with: | |
src: github/Hebau-Community | |
dst: gitee/Hebau-Community | |
dst_key: ${{ secrets.GITEE_RSA }} | |
dst_token: ${{ secrets.GITEE_TOKEN }} | |
account_type: org | |
force_update: true | |
# white_list: | |
black_list: '.github' | |
# static_list: | |
# - name: Mirror personal | |
# uses: Yikun/hub-mirror-action@master | |
# with: | |
# src: github/Weidows | |
# dst: gitee/Weidows | |
# dst_key: ${{ secrets.GITEE_RSA }} | |
# dst_token: ${{ secrets.GITEE_TOKEN }} | |
# white_list: "" | |
# black_list: | |
# static_list: | |
# force_update: true | |
# https://github.com/mxschmitt/action-tmate | |
ssh-debug: | |
runs-on: ubuntu-latest | |
steps: | |
# Enable tmate debugging of manually-triggered workflows if the input option was provided | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
timeout-minutes: 15 | |
with: | |
limit-access-to-actor: true |