forked from Controls/gitea-pages
531b3ccc83
Build and Deploy Documentation / build-and-deploy (push) Successful in 7s
If this repo is forked, push to the forked repo, not to the original. Also make sure the gitea link points back to this repo.
38 lines
1.1 KiB
YAML
38 lines
1.1 KiB
YAML
name: Build and Deploy Documentation
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: gitea.psi.ch/images/alpine-zensical
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build page
|
|
run: |
|
|
sed -i 's|repo_url[[:space:]]*=[[:space:]]*".*"|repo_url = "${{ github.server_url }}/${{ github.repository }}"|' zensical.toml
|
|
/opt/python-env/bin/zensical build
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config --global user.name "Gitea Actions"
|
|
git config --global user.email "actions@gitea.local"
|
|
|
|
- name: Push to gitea-pages branch
|
|
run: |
|
|
git checkout --orphan gitea-pages
|
|
git reset --hard
|
|
mv site/* .
|
|
git add .
|
|
git commit -m "Update site - $(date)"
|
|
REPO_URL=$(echo "${{ github.server_url }}/${{ github.repository }}.git" | sed 's|https://||')
|
|
git push -f https://${{ secrets.GITHUB_TOKEN }}@$REPO_URL gitea-pages
|
|
|