85 lines
2.4 KiB
YAML
85 lines
2.4 KiB
YAML
name: Build and Push MkDocs Site
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main # Trigger on pushes to the main branch
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.14'
|
|
|
|
- name: Install uv
|
|
run: |
|
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
shell: bash
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
export PATH="$HOME/.local/bin:$PATH"
|
|
uv pip install --system -r requirements.txt
|
|
shell: bash
|
|
|
|
- name: Setup SSH for Multirepo
|
|
uses: webfactory/ssh-agent@v0.9.0
|
|
with:
|
|
ssh-private-key: ${{ secrets.GIT_SSH_KEY }}
|
|
|
|
- name: Add known_hosts
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
ssh-keyscan -p 2222 gitea.rwcloud.ch >> ~/.ssh/known_hosts
|
|
shell: bash
|
|
|
|
- name: Build Website
|
|
run: mkdocs build
|
|
|
|
- name: Login to Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.rwcloud.ch
|
|
username: build.user
|
|
password: ${{ secrets.AUTH_TOKEN }}
|
|
|
|
- name: Build and push Docker images
|
|
uses: docker/build-push-action@v6.9.0
|
|
with:
|
|
push: true
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
tags: gitea.rwcloud.ch/homelab/wiki:latest
|
|
|
|
# TODO: Deploy muss neu geschrieben werden
|
|
# deploy:
|
|
# needs: build-and-push
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - name: executing remote ssh commands using ssh key
|
|
# uses: appleboy/ssh-action@v1.2.0
|
|
# with:
|
|
# host: ${{ secrets.SSH_HOST }}
|
|
# username: ${{ secrets.SSH_USERNAME }}
|
|
# key: ${{ secrets.SSH_KEY }}
|
|
# port: ${{ secrets.SSH_PORT }}
|
|
# script: |
|
|
# cd ~/ansible
|
|
# git pull
|
|
# source ./.venv/bin/activate
|
|
# pip install -r requirements.txt
|
|
# ansible-playbook -i inventory/hosts.yml --vault-password-file ./.vault_pass playbooks/proxmox/deploy_docker_services.yml --tags oauth2-wiki,wiki-uninstall
|
|
# ansible-playbook -i inventory/hosts.yml --vault-password-file ./.vault_pass playbooks/proxmox/deploy_docker_services.yml --tags oauth2-wiki,wiki-install
|
|
# deactivate
|
|
|
|
|
|
|