Skip to content

CI-CD

CI-CD #6

Workflow file for this run

# 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 }}