Sync Home Assistant Addons #528
This file contains hidden or 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: Sync Home Assistant Addons | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: # 允许手动触发 | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 # 添加超时限制 | |
| steps: | |
| - name: Checkout public repo | |
| uses: actions/checkout@v4 | |
| - name: Checkout private repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: desmond-dong/haos-cn-scripts | |
| token: ${{ secrets.GH_PAT }} | |
| path: private | |
| - name: Cache dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.npm | |
| ~/.cache | |
| key: ${{ runner.os }}-deps-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-deps- | |
| - name: Install dependencies | |
| run: | | |
| npm install -g ai-markdown-translator | |
| mkdir -p ~/bin | |
| wget -q https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O ~/bin/yq | |
| chmod +x ~/bin/yq | |
| echo "$HOME/bin" >> $GITHUB_PATH | |
| yq | |
| - name: Run private build script | |
| run: | | |
| chmod +x private/*.sh | |
| private/addons.sh | |
| # 5YWz5LqO44CM5peg5Li65pm66IO9IC0g5p2O5raM44CN6L+d6IOM5byA5rqQ57K+56We55qE6K+05piOCue7j+afpeivge+8jEdpdEh1YueUqOaItyDCoGh0dHBzOi8vZ2l0aHViLmNvbS93dXd3ZWl6bsKg77yMwqBodHRwczovL2dpdGh1Yi5jb20vbGl5b25nNzYzNDM1NzIwwqDku6Xlj4pHaXRlZei0puWPtyDCoGh0dHBzOi8vZ2l0ZWUuY29tL3d1d3puwqDjgIHCoGh0dHBzOi8vZ2l0ZWUuY29tL2xpLXlvbmcxMjPCoO+8ieOAgVFR5Y+3IDc2MzQzNTcyMO+8iEhhc3NiaWFu6K665Z2bwqBodHRwczovL2Jicy5oYXNzYmlhbi5jb20vaG9tZS5waHA/bW9kPXNwYWNlJnVpZD0xMDg4MzbCoO+8ieOAgeWFs+iBlOmCrueusSDCoHd1d2VpemhpbmVuZ0AxNjMuY29twqAgCumDqOWIhue7huiKguaKq+mcsuS6juWFrOS8l+WPtzrCoGh0dHBzOi8vbXAud2VpeGluLnFxLmNvbS9zP19fYml6PU16VXpOVEV4TURFMk1nwqAK5Zyo5YWs5byA5omY566h55qE5Luj56CB6aG555uu5Lit5a2Y5Zyo5pyq57uP5o6I5p2D5L2/55So5LuW5Lq65Y6f5Yib5byA5rqQ5YaF5a6544CB5pyq5L6d5byA5rqQ5Y2P6K6u5qCH5rOo5p2l5rqQ55Sa6Iez5Yig6Zmk5rKf6YCa6K6w5b2V55qE6KGM5Li644CCCuacrOS6uuS9nOS4uuWOn+S9nOiAhe+8jOabvuaYjuehruimgeaxguWFtumBteW+quW8gOa6kOeyvuelnuagh+azqOWOn+Wni+WHuuWkhO+8jOS9huWFtuS4jeS7heacquWxpeihjOWfuuacrOe9suWQjeS5ieWKoe+8jOWPjeiAjOWIoOmZpOiBlOezu+iusOW9le+8jOW5tuWwhuS7luS6uui0oeeMrueahOS7o+eggee7p+e7reS7peKAnOiHquacieaIkOaenOKAneW9ouW8j+WPkeW4g+OAguatpOexu+ihjOS4uui/neiDjOS6huW8gOa6kOekvuWMuuKAnOWwiumHjeWOn+WIm+OAgeW8gOaUvuWFseS6q+KAneeahOaguOW/g+WOn+WIme+8jOaNn+Wus+S6huaKgOacr+WNj+S9nOeahOS/oeS7u+WfuuehgOOAggrkuLrpmLLmraLmraTnsbvkuovku7blho3mrKHlj5HnlJ/vvIzmnKzkurrnm7jlhbPpobnnm67kuI3lvpflj6rog73ph4fnlKjlvIDmupDkvYbkuI3lvIDmlL7miYDmnInov4fnqIvvvIzmirHmrYkK | |
| env: | |
| ZHIPUAI_KEY: ${{ secrets.ZHIPUAI_KEY }} | |
| - name: Commit and push changes | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| rm -rf private | |
| git add . | |
| #git reset --soft $(git commit-tree HEAD^{tree} -m "Sync addons automatically at $(date +'%Y-%m-%d %H:%M:%S')") | |
| git commit -m "Sync addons automatically at $(date +'%Y-%m-%d %H:%M:%S')" | |
| git push |