Skip to content

Commit b66e1e3

Browse files
committed
feat: ci/cd
1 parent 320b420 commit b66e1e3

17 files changed

Lines changed: 624 additions & 1327 deletions

File tree

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: '[DOCS] Test Build'
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- docs-prod
7+
8+
jobs:
9+
test-build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: ["${{ vars.NODE_VERSION || '20.18' }}"]
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Clean dependencies
17+
run: rm -rf package-lock.json node_modules
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
- name: Install dependencies
23+
run: npm install
24+
- name: Build project
25+
run: npm run build

.github/workflows/deploy.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: '[DOCS] PROD'
2+
3+
on:
4+
push:
5+
branches:
6+
- docs-prod
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: ["${{ vars.NODE_VERSION || '20.18' }}"]
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Archived project
17+
run: |
18+
tar -cf public_html.tar --force-local ./
19+
- name: Uploading the archive to the server
20+
uses: appleboy/scp-action@master
21+
with:
22+
host: ${{ secrets.SITE_HOST }}
23+
username: ${{ secrets.USERNAME }}
24+
password: ${{ secrets.PASSWORD }}
25+
port: 22
26+
source: 'public_html.tar'
27+
target: './'
28+
- name: The final stage of deployment. Removing, unzipping, building the project
29+
uses: appleboy/ssh-action@master
30+
with:
31+
host: ${{ secrets.SITE_HOST }}
32+
username: ${{ secrets.USERNAME }}
33+
password: ${{ secrets.PASSWORD }}
34+
port: 22
35+
script: |
36+
source $HOME/.bashrc
37+
38+
NODE_VERSION=${{ vars.NODE_VERSION || '20.18' }}
39+
CURRENT_NODE_VERSION=$(node -v)
40+
if [[ $CURRENT_NODE_VERSION != v$NODE_VERSION* ]]; then
41+
nvm alias default $NODE_VERSION
42+
nvm use default
43+
fi
44+
45+
cd $HOME/${{ secrets.SITE_PATH }}
46+
rm -rf ./* &>/dev/null
47+
tar -xf $HOME/public_html.tar -C $HOME/${{ secrets.SITE_PATH }}/
48+
rm $HOME/public_html.tar
49+
cd $HOME/${{ secrets.SITE_PATH }}
50+
sed -i 's/"name": *".*"/"name": "${{ secrets.USERNAME }}"/' package.json
51+
npm install
52+
npm run build
53+
54+
if ! command -v pm2 &> /dev/null; then
55+
echo 'export PATH=/usr/lib/ispnodejs/bin:$PATH' >> $HOME/.bashrc
56+
source $HOME.bashrc
57+
fi
58+
pm2 restart ${{ secrets.USERNAME }}

assets/styles/_js.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
@import '@fancyapps/ui/dist/fancybox/fancybox.css';
2-
@import 'js/fancybox';
3-
41
@import 'js/tippy';

composables/useModal.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.

examples/all-icons/dynamic.html

Lines changed: 0 additions & 16 deletions
This file was deleted.

examples/all-icons/sprite.html

Lines changed: 0 additions & 19 deletions
This file was deleted.

examples/all-icons/static.html

Lines changed: 0 additions & 20 deletions
This file was deleted.

examples/base-template/index.html

Lines changed: 0 additions & 18 deletions
This file was deleted.

examples/cdn/bundle.html

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/cdn/module.html

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)