Skip to content

Commit

Permalink
build: create ci-cd Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
tmlmt committed May 15, 2023
1 parent 67a2a94 commit 4e07ea1
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/CI-CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: CI-CD

on:
release:
types: [published]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v2
with:
run_install: true
- name: create env file
run: |
touch .env
echo NODE_ENV="production" >> .env
echo NUXT_PUBLIC_SITE_URL="https://www.tmlmt.com" >> .env
- name: Build app
run: pnpm generate
- name: Deploy to Production server
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
REMOTE_HOST: ${{ secrets.SSH_HOST }}
REMOTE_USER: ${{ secrets.SSH_USER }}
REMOTE_PORT: ${{ secrets.SSH_PORT }}
SOURCE: '.output/public'
TARGET: ${{ secrets.TARGET_DIR }}

0 comments on commit 4e07ea1

Please sign in to comment.