Skip to content

Commit 0ac5c86

Browse files
committed
test: github action reset
1 parent 5b96929 commit 0ac5c86

File tree

1 file changed

+32
-52
lines changed

1 file changed

+32
-52
lines changed

.github/workflows/main.yml

Lines changed: 32 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,40 @@
1-
name: Publish And Deploy Demo
1+
name: Deployment
22
on:
33
push:
44
branches:
5-
- nuxt
6-
5+
- main
76
jobs:
8-
build-and-deploy:
7+
deploy:
98
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
node-version: [12.x]
1012
steps:
11-
12-
# 下载源码
13-
- name: Checkout
14-
uses: actions/checkout@master
15-
16-
# 打包构建
17-
- name: Build
18-
uses: actions/setup-node@master
19-
- run: npm install
20-
- run: npm run build
21-
- run: tar -zcvf release.tgz .nuxt server nuxt.config.js package.json
22-
23-
# 发布 Release
24-
- name: Create Release
25-
id: create_release
26-
uses: actions/create-release@master
27-
env:
28-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
- uses: actions/checkout@v1
14+
- name: Use Node.js ${{ matrix.node-version }}
15+
uses: actions/setup-node@v1
2916
with:
30-
tag_name: ${{ github.ref }}
31-
release_name: Release ${{ github.ref }}
32-
draft: false
33-
prerelease: false
34-
35-
# 上传构建结果到 Release
36-
- name: Upload Release Asset
37-
id: upload-release-asset
38-
uses: actions/upload-release-asset@master
39-
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
node-version: ${{ matrix.node-version }}
18+
- name: Install Yarn
19+
run: npm i -g yarn
20+
- name: Use Yarn Install Packages
21+
run: yarn
22+
- name: Build page
23+
run: yarn build
24+
- name: Build Zip
25+
run: tar -zcvf release.tgz .nuxt server nuxt.config.js package.json
26+
- name: ssh deploy
27+
uses: easingthemes/[email protected]
4128
with:
42-
upload_url: ${{ steps.create_release.outputs.upload_url }}
43-
asset_path: ./release.tgz
44-
asset_name: release.tgz
45-
asset_content_type: application/x-tgz
46-
47-
# 部署到服务器
48-
- name: Deploy
49-
uses: appleboy/ssh-action@master
50-
with:
51-
host: ${{ secrets.HOST }}
52-
username: ${{ secrets.USERNAME }}
53-
password: ${{ secrets.PASSWORD }}
54-
port: ${{ secrets.PORT }}
55-
script: |
56-
cd /www/wwwroot/root
57-
wget https://github.com/geekape/geek-navigation/releases/latest/download/release.tgz -O release.tgz
58-
tar zxvf release.tgz
59-
ls
60-
pm2 start nav
29+
# Private Key
30+
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
31+
# Remote host
32+
REMOTE_HOST: ${{secrets.HOST}}
33+
# Remote user
34+
REMOTE_USER: ${{secrets.USERNAME}}
35+
# Remote port
36+
REMOTE_PORT: ${{secrets.PORT}}
37+
# Source directory
38+
SOURCE: release.tgz
39+
# Target directory
40+
TARGET: /www/wwwroot/root/

0 commit comments

Comments
 (0)