Skip to content

Commit 4e07ea1

Browse files
authored
build: create ci-cd Github Action
1 parent 67a2a94 commit 4e07ea1

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/CI-CD.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: CI-CD
5+
6+
on:
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: [16.x]
18+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v3
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
- uses: pnpm/action-setup@v2
28+
with:
29+
run_install: true
30+
- name: create env file
31+
run: |
32+
touch .env
33+
echo NODE_ENV="production" >> .env
34+
echo NUXT_PUBLIC_SITE_URL="https://www.tmlmt.com" >> .env
35+
- name: Build app
36+
run: pnpm generate
37+
- name: Deploy to Production server
38+
uses: easingthemes/ssh-deploy@main
39+
env:
40+
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
41+
REMOTE_HOST: ${{ secrets.SSH_HOST }}
42+
REMOTE_USER: ${{ secrets.SSH_USER }}
43+
REMOTE_PORT: ${{ secrets.SSH_PORT }}
44+
SOURCE: '.output/public'
45+
TARGET: ${{ secrets.TARGET_DIR }}

0 commit comments

Comments
 (0)