Enables seo docs #6
This file contains 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
# DOCUMENT_ROOT is the file path on the server up to the public folder | |
# with a trailing slash. Add 'public/' to target public folder. | |
# /server/path_html (default) | |
# TARGET: ${{ secrets.DOCUMENT_ROOT }}/public/docs/craft-v2/ (subfolder) | |
name: Deploy v5 Docs | |
on: | |
push: | |
branches: | |
- craft-v5 | |
jobs: | |
build_and_deploy_files: | |
name: Run build script and deploy files | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.ref || github.ref }} | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: Install npm dependencies | |
run: npm install | |
- name: Run build task | |
run: npm run docs:build | |
- name: Deploy files to server | |
uses: easingthemes/[email protected] | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} | |
REMOTE_USER: ${{ secrets.REMOTE_USER }} | |
TARGET: ${{ secrets.DOCUMENT_ROOT }}docs/craft-v5/ | |
ARGS: "-rltgoDzvO --delete" | |
SOURCE: "docs/.vitepress/dist/" | |
# This section can be removed for all branches except the current version release branch | |
- name: Symlink doc folders to public folder | |
uses: appleboy/[email protected] | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
host: ${{ secrets.REMOTE_HOST }} | |
username: ${{ secrets.REMOTE_USER }} | |
script: | | |
ln -sfn ${{ secrets.DOCUMENT_ROOT }}docs/craft-v5 ${{ secrets.DOCUMENT_ROOT }}public/docs/craft-v5 | |
ln -sfn ${{ secrets.DOCUMENT_ROOT }}docs/craft-v4 ${{ secrets.DOCUMENT_ROOT }}public/docs/craft-v4 | |
ln -sfn ${{ secrets.DOCUMENT_ROOT }}docs/craft-v3 ${{ secrets.DOCUMENT_ROOT }}public/docs/craft-v3 | |
ln -sfn ${{ secrets.DOCUMENT_ROOT }}docs/craft-v2 ${{ secrets.DOCUMENT_ROOT }}public/docs/craft-v2 | |