privatecoffee-website/.forgejo/workflows/build-pride.yml
Kumi e2d35c7893
All checks were successful
Build and Deploy Static Site (Pride Theme) / build (push) Successful in 55s
Build and Deploy Static Site / build (push) Successful in 56s
feat(build): add theme parameter to static site generator
Included a --theme pride parameter to the generate static site
command in the build workflow. This allows theme customization
during site generation, enhancing site appearance and flexibility.
2024-09-24 08:15:07 +02:00

50 lines
1.4 KiB
YAML

name: Build and Deploy Static Site (Pride Theme)
on:
push:
branches:
- main
jobs:
build:
container: node:20-bookworm
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
apt update
apt install -y python3 python3-pip
python3 -m pip install -r requirements.txt --break-system-packages
- name: Generate static site
run: python3 main.py --theme pride
- name: Deploy to pages branch
run: |
# Configure Git
git config --global user.name "Forgejo"
git config --global user.email "noreply@private.coffee"
# Move generated static site files to a temporary location
mv build ../static_site_temp
cp .gitignore ../static_site_temp
# Create a new orphan branch named 'pages-pride'
git checkout --orphan pages-pride
# Remove all files from the working directory
git rm -rf .
# Move the static site files back to the working directory
mv ../static_site_temp/* ./
mv ../static_site_temp/.* ./ 2>/dev/null || true
# Add and commit the static site files
git add .
git commit -m "Deploy static site"
# Force push to the 'pages-pride' branch
git push origin pages-pride --force