feat: 方块状态的无效组合拆分出状态别名与有效值重写 #129
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: Deploy | |
on: | |
push: | |
branches: [ "master" ] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Checkout database | |
uses: actions/checkout@v4 | |
with: | |
path: database | |
- name: Install and export database | |
working-directory: ${{ github.workspace }}/database | |
run: | | |
npm install | |
npm run generate-all | |
- name: Checkout web | |
uses: actions/checkout@v4 | |
with: | |
repository: XeroAlpha/caidlistweb | |
path: web | |
- name: Copy database files | |
run: | | |
cp -r ${{ github.workspace }}/database/output/web ${{ github.workspace }}/web/public/data | |
cp ${{ github.workspace }}/database/output/web/index.json ${{ github.workspace }}/web/src/assets/dataIndex.json | |
- name: Install and build web | |
working-directory: ${{ github.workspace }}/web | |
run: | | |
yarn install | |
yarn build | |
- name: Deploy to self-hosted site | |
if: github.repository == 'XeroAlpha/caidlist' | |
run: | | |
pushd ${{ github.workspace }}/web/dist | |
tar -cvzf ${{ github.workspace }}/idlist.tar.gz * | |
popd | |
echo "${{ secrets.SSH_KEY }}" > ${{ github.workspace }}/key.txt | |
chmod 400 ${{ github.workspace }}/key.txt | |
scp -q -P ${{ secrets.PORT }} -o StrictHostKeyChecking=no -i ${{ github.workspace }}/key.txt ${{ github.workspace }}/idlist.tar.gz "${{ secrets.USERNAME }}"@"${{ secrets.HOST }}":/tmp/idlist.tar.gz | |
ssh -q -p ${{ secrets.PORT }} -o StrictHostKeyChecking=no -i ${{ github.workspace }}/key.txt "${{ secrets.USERNAME }}"@"${{ secrets.HOST }}" "rm -rf ${{ secrets.TARGET_PATH }}/* && tar -xvzf /tmp/idlist.tar.gz -C ${{ secrets.TARGET_PATH }} && rm -f /tmp/idlist.tar.gz" | |
rm ${{ github.workspace }}/key.txt | |
- name: Setup GitHub Pages | |
id: pages_setup | |
uses: actions/configure-pages@v4 | |
continue-on-error: true | |
- name: Upload artifact to GitHub pages | |
if: ${{ steps.pages_setup.outcome == 'success' }} | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ${{ github.workspace }}/web/dist | |
- name: Deploy to GitHub Pages | |
if: ${{ steps.pages_setup.outcome == 'success' }} | |
id: deployment | |
uses: actions/deploy-pages@v4 |