Situation
# Github要在0點做每天更新 > Schedule
Perform a daily update at 00:00 on Github.
Solution
# 修改Azure SWA的Workflow檔案
# 0(分) UTC16:00(台灣是UTC+8 > 16+8=24,剛好0點更新) 每天 每月 每週
on:
schedule:
- cron: "0 16 * * *"
# 修改job裡面的觸發條件,除了push以外schedule也會觸發
jobs:
build_and_deploy_job:
if: github.event_name == 'push' || github.event_name == 'schedule'
# 新增一個檔案進入public資料夾,因為檔案有變動所以能讓hugo重新Build網站
steps:
- name: Force Deploy Timestamp
run: echo $(date) > public/.build-timestamp.txt