Skip to content

Merge pull request #101 from our-mini-games/feat-Chinese-chess #121

Merge pull request #101 from our-mini-games/feat-Chinese-chess

Merge pull request #101 from our-mini-games/feat-Chinese-chess #121

Workflow file for this run

name: ci
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout pnpm
uses: pnpm/action-setup@v2.0.1
with:
version: 7.13.4
# 构建入口项目
- name: Build Entry
run: cd ./packages/entry && pnpm install && pnpm run build && mkdir dist/games && cp dist/index.html dist/404.html
# 构建扫雷项目
- name: Build Mine-sweeper
run: pwd && cd ./packages/mine-sweeper && pnpm install && pnpm run build && mv dist ../entry/dist/games/mine-sweeper
# 构建连连看项目
- name: Build Link-game
run: pwd && cd ./packages/link-game && pnpm install && pnpm run build && mv dist ../entry/dist/games/link-game
# 构建贪吃蛇项目
- name: Build Greedy-snake
run: pwd && cd ./packages/greedy-snake && pnpm install && pnpm run build && mv dist ../entry/dist/games/greedy-snake
# 构建俄罗斯方块项目
- name: Build Tetris
run: pwd && cd ./packages/tetris && pnpm install && pnpm run build && mv dist ../entry/dist/games/tetris
# 构建2048项目
- name: Build 2048
run: pwd && cd ./packages/2048 && pnpm install && pnpm run build && mv dist ../entry/dist/games/2048
# 构建蜘蛛纸牌项目
- name: Build Spider-solitaire
run: pwd && cd ./packages/spider-solitaire && pnpm install && pnpm run build && mv dist ../entry/dist/games/spider-solitaire
# 构建中国象棋项目
- name: Build Chinese chess
run: pwd && cd ./packages/Chinese-chess && pnpm install && pnpm run build && mv dist ../entry/dist/games/chinese-chess
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: './packages/entry/dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1