Skip to content

Deployment (Prod) 🚀 #4

Deployment (Prod) 🚀

Deployment (Prod) 🚀 #4

Workflow file for this run

name: Deployment (Prod) 🚀
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
strategy:
matrix:
node-version: [18.x]
steps:
- name: 🚚 Get Latest Code
uses: actions/checkout@v3
with:
fetch-depth: 0
## —— Node ————————————————————————————————————————————————
- name: 🛠 Install Dependencies
run: npm install
- name: 🛠 Build NX
uses: mansagroup/nrwl-nx-action@v3
with:
targets: build
all: true
- name: Remove not required files
run: |
rm -rf node_modules
## —— Deployment ————————————————————————————————————————————————
- name: 🚀 Upload files via SCP
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SFTP_USERNAME }}
password: ${{ secrets.SFTP_PASSWORD }}
port: 22
source: "./*"
target: ${{ secrets.DEPLOYMENT_PATH }}
clear-cache:
name: 🧹 Clear Cache
needs: deploy
runs-on: ubuntu-latest
environment: production
steps:
- name: SSH and Clear Symfony Cache
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SFTP_USERNAME }}
password: ${{ secrets.SFTP_PASSWORD }}
port: 22
script: |
cd ${{ secrets.DEPLOYMENT_PATH }}
php81 `which composer` cache