Fix MDX JSON-LD blocks using Head + JSON.stringify #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy Docusaurus (Strict FTPS via lftp) | |
on: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: docusaurus-deploy | |
cancel-in-progress: true | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
- name: Install and Build | |
run: | | |
npm ci | |
npm run build | |
- name: Deploy via FTPS (explicit/21, strict, TLS1.2) | |
env: | |
FTP_HOST: ${{ secrets.FTP_HOST }} | |
FTP_USER: ${{ secrets.FTP_USER }} | |
FTP_PASS: ${{ secrets.FTP_PASS }} | |
FTP_DIR: ${{ secrets.FTP_SERVER_DIR }} # must end with / | |
run: | | |
sudo apt-get update -y && sudo apt-get install -y lftp ca-certificates | |
lftp -u "$FTP_USER","$FTP_PASS" "ftp://$FTP_HOST:21" -e " | |
set net:max-retries 2; | |
set net:timeout 25; | |
set ftp:passive-mode on; | |
set ftp:prefer-epsv no; # avoid EPSV (common FTPS data TLS issue) | |
set ftp:use-feat yes; | |
set ftp:ssl-allow yes; | |
set ftp:ssl-force yes; # explicit FTPS (AUTH TLS) | |
set ftp:ssl-protect-data yes; # PROT P for data channel | |
set ftp:ssl-protect-list yes; | |
set ssl:verify-certificate yes; # strict certs | |
set ssl:ca-file /etc/ssl/certs/ca-certificates.crt; | |
set ssl:priority 'NORMAL:-VERS-TLS1.3'; # prefer TLS1.2 (some servers bug on 1.3 data) | |
cd $FTP_DIR; | |
mirror --reverse --delete --verbose \ | |
--transfer-all --parallel=2 \ | |
--exclude-glob .git* \ | |
--exclude-glob node_modules \ | |
./build/ ./ | |
bye | |
" |