Files
my-ccna-notes/.gitea/workflows/build-and-deploy.yaml
T

38 lines
972 B
YAML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Build and Deploy mdBook
on:
push:
branches:
- main  
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install mdbook
run: cargo install mdbook --version "^0.4.44"
- name: Build mdbook
run: mdbook build
- name: Install rsync
run: sudo apt-get update && sudo apt-get install -y rsync
- name: Deploy to server (using rsync - example)
uses: easingthemes/ssh-deploy@v2.1.5
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: "-rltgoDzvO --delete" # Adjust rsync options as needed
SOURCE: "book/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: "/root/mdbook/my-ccna-notes"