u10homepage/.gitea/workflows/deploy.yml

44 lines
1.5 KiB
YAML
Raw Normal View History

2024-03-17 11:00:53 +00:00
name: MkDocs Build and Deploy
run-name: ${{ gitea.actor }} is deploying U.10 Makerspace site 🚀
2024-03-17 11:09:30 +00:00
on:
push:
branches:
- main
2024-03-17 11:00:53 +00:00
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Install Python
run: apt-get update && apt-get install python3-pip python3-venv -y
- name: Build MkDocs site
run: |
pip install mkdocs
pip install mkdocs-material
2024-03-17 11:21:21 +00:00
pip install "mkdocs-material[imaging]"
2024-03-17 11:00:53 +00:00
pip install mkdocs-macros-plugin
pip install mkdocs-glightbox
pip install mkdocs-include-markdown-plugin
pip install mkdocs-video
pip install mkdocs-rss-plugin
pip install mkdocs-snippets
pip install mkdocs-exclude
2024-03-17 11:15:27 +00:00
pip install mkdocs-minify-plugin
2024-03-17 11:00:53 +00:00
mkdocs build
- name: Set google verification
env:
GOOGLE_VERIFICATION: ${{ vars.U10_GOOGLE_SITE_VERIFICATION }}
run: |
2024-03-18 11:21:49 +00:00
echo google-site-verification: $GOOGLE_VERIFICATION > ./site/$GOOGLE_VERIFICATION
2024-03-17 11:00:53 +00:00
- name: Install lftp
run: apt-get install lftp -y
- name: Deploy MkDocs site
env:
FTP_USERNAME: ${{ vars.U10_FTP_USER }}
FTP_PASSWORD: ${{ secrets.U10_FTP_PASSWORD }}
FTP_SERVER: ${{ vars.U10_FTP_SERVER }}
run: |
lftp -c "set ftp:ssl-allow no; open '$FTP_SERVER'; user '$FTP_USERNAME' '$FTP_PASSWORD'; mirror --reverse --delete --verbose ./site /; bye"