更新网站 #61
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: 更新网站 | |
on: | |
workflow_dispatch: | |
inputs: | |
actUpdated: | |
description: '更新了吗(yes/no)' | |
required: true | |
default: 'yes' | |
actVersion: | |
description: '游戏版本号(x.xx)' | |
required: true | |
default: '5.31' | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
persist-credentials: false | |
- name: Build | |
run: bash make.sh | |
env: | |
ACT_UPDATED: ${{ github.event.inputs.actUpdated }} | |
ACT_VERSION: ${{ github.event.inputs.actVersion }} | |
- name: Deploy | |
uses: JamesIves/[email protected] | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages | |
FOLDER: www | |
CLEAN: true | |
- name: Trigger API | |
run: | | |
curl -H "X-CafeMenu-Auth: $CAFEMENU_SECRET" \ | |
https://cafemenu.xivcdn.com/edit/act/ready \ | |
--data $([[ "$ACT_UPDATED" = yes ]] && echo 'data=1' || echo 'data=0') \ | |
-so /dev/null | |
env: | |
CAFEMENU_SECRET: ${{ secrets.CAFEMENU_SECRET }} | |
ACT_UPDATED: ${{ github.event.inputs.actUpdated }} |