Some checks failed
Build and Deploy MkDocs / build-deploy (push) Failing after 37s
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: Build and Deploy MkDocs
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build-deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Set up container
|
|
run: |
|
|
apt update
|
|
apt install -y rsync
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Install MkDocs
|
|
run: |
|
|
pip install --upgrade pip
|
|
pip install mkdocs mkdocs-material pymdown-extensions mkdocs-material-extensions
|
|
|
|
- name: Build site
|
|
run: mkdocs build --clean
|
|
|
|
- name: Setup SSH
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_rsa
|
|
chmod 600 ~/.ssh/id_rsa
|
|
ssh-keyscan -p ${{
|
|
secrets.DEPLOY_PORT || 22
|
|
}} ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts
|
|
|
|
- name: Deploy with rsync
|
|
run: |
|
|
rsync -avz --delete \
|
|
--filter='P error/' \
|
|
--filter='P stats/' \
|
|
-e "ssh -p ${{ secrets.DEPLOY_PORT || 22 }}" \
|
|
site/ \
|
|
${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:/var/www/dev.postalpoint.app/web
|