-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
SliverRiver327
authored and
SliverRiver327
committed
Jan 7, 2024
0 parents
commit e3557a2
Showing
23 changed files
with
18,839 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Site workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
CI: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [20] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "pnpm" | ||
- name: Cache node_modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/pnpm.lock')) }} | ||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: pnpm install | ||
- name: Set up environment | ||
env: | ||
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | ||
run: | | ||
sudo timedatectl set-timezone "Asia/Shanghai" | ||
mkdir -p ~/.ssh | ||
echo "$DEPLOY_KEY" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
- name: Generate Site | ||
run: pnpm build | ||
- name: Deploy to GitHub Pages | ||
run: | | ||
cd ./dist | ||
git config user.name slivermoe | ||
git config user.email [email protected] | ||
git add . | ||
current_time=`date '+%Y-%m-%d %H:%m:%S'` | ||
git branch -M gh-pages | ||
git commit -m "Updated at $current_time" | ||
git push -u origin gh-pages |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
Oops, something went wrong.