Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加自动部署ci #24

Open
smallfangqwq opened this issue Jun 18, 2024 · 2 comments
Open

添加自动部署ci #24

smallfangqwq opened this issue Jun 18, 2024 · 2 comments

Comments

@smallfangqwq
Copy link

No description provided.

@smallfangqwq
Copy link
Author

同时gitignore一下start.json 谢谢。

@wxh06
Copy link
Member

wxh06 commented Jun 18, 2024

现在是有构建的 CI 的:

---
name: Build artifacts
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create configuration files
run: |
echo $NPMRC > .npmrc
echo $ENV_LOCAL > packages/viewer/.env.local
env:
NPMRC: |
node-linker=hoisted
ENV_LOCAL: ${{ vars.ENV_LOCAL }}
- uses: pnpm/action-setup@v2
with:
version: 9
- name: Use Node.js LTS
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Next.js build cache
uses: actions/cache@v3
with:
path: packages/viewer/.next/cache/
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('packages/viewer/**/*.[jt]s', 'packages/viewer/**/*.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-
${{ runner.os }}-nextjs-
- name: Build
run: pnpm -r run build
- name: Upload luogu-discussion-archive
uses: actions/upload-artifact@v3
with:
name: luogu-discussion-archive
path: packages/archive/dist/
- name: Upload luogu-discussion-viewer
uses: actions/upload-artifact@v3
with:
name: luogu-discussion-viewer
path: |
packages/viewer/.next/
!packages/viewer/.next/cache/

稍后我重新整理一下部署的命令(shell history 已经跟着过期服务器一起消失了)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants