fix: 修复了剪切板提交后页面样式 #221
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 # default branch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- name: Cache NPM dependencies | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-npm-cache | |
restore-keys: | | |
${{ runner.OS }}-npm-cache | |
- name: MakeCategory | |
run: | | |
pushd ./makeCategory | |
./build.sh | |
popd | |
pushd ./public | |
./makeCategory | |
popd | |
- name: Setup SSH Private Key | |
env: | |
KEY: ${{ secrets.KEY }} | |
IP: ${{ secrets.IP }} | |
run: | | |
mkdir -p ~/.ssh/ | |
echo "$KEY" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan $IP >> ~/.ssh/known_hosts | |
- name: Install deps | |
run: | | |
sudo apt install expect tcl-expect -y | |
- name: Upload website | |
env: | |
IP: ${{ secrets.IP }} | |
run: | | |
rm -rf website* | |
# Build website | |
npm i | |
npm run build | |
zip -r website.zip website/ | |
scp website.zip aosc@$IP:/home/aosc/web/ | |
- name: Unzip website | |
run: | | |
cd deploy | |
./unzipServer.sh |