Skip to content

CD

CD #97

Workflow file for this run

name: CD
on:
workflow_run:
workflows:
- 'CI'
types:
- completed
jobs:
build:
name: 'Build & Publish'
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
# - name: ☁️ Checkout Repository
# uses: actions/checkout@v3
# - name: 🔧 Install pnpm
# uses: pnpm/action-setup@v2
# - name: 🔧 Use Node.js 18
# uses: actions/setup-node@v3
# with:
# node-version: 18
# registry-url: https://registry.npmjs.org/
# cache: pnpm
# - name: 📦 Install monorepo deps
# run: pnpm i
# - name: 🚀 Build front-end project
# run: pnpm web:build
# - name: ✅ Deploy front-end project
# uses: easingthemes/ssh-deploy@v4.1.8
# env:
# SSH_PRIVATE_KEY: ${{ secrets.SERVER_PRIVATE_KEY }}
# ARGS: '-avz --delete'
# SOURCE: 'web/dist'
# REMOTE_HOST: ${{ secrets.SERVER_HOST }}
# REMOTE_USER: ${{ secrets.SERVER_USERNAME }}
# TARGET: /usr/share/nginx/html
# SCRIPT_AFTER: |
# systemctl restart nginx
- name: 🔧 Setup SSH
uses: appleboy/ssh-action@v0.1.10
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
script: cd ${{ secrets.SERVER_REPO_PATH }} && sh bin/deploy.sh