otmp_site/.forgejo/workflows/ci.yml
Awiteb 9483e897d3
All checks were successful
Build site / Rust CI (push) Successful in 4s
chore: Create publich ci
Signed-off-by: Awiteb <a@4rs.nl>
2024-06-01 14:03:49 +03:00

33 lines
1 KiB
YAML

name: Build site
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build_ci:
name: Rust CI
runs-on: debian
steps:
- uses: actions/checkout@v4
- name: Build the site
run: |
curl -s -L https://github.com/getzola/zola/releases/download/v0.18.0/zola-v0.18.0-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - -C .
./zola build
- name: Publish the site
run: |
cd public
git init
git checkout -B site
git config user.name forgejo-actions
git config user.email forgejo-actions@noreply.localhost
URL=$(echo $GITHUB_SERVER_URL | sed -E 's/^\s*.*:\/\///g')
# Http and not https because the request is inside the instance network
git remote add origin http://forgejo-actions:$GITHUB_TOKEN@$URL/$GITHUB_REPOSITORY.git
echo "otmp.4rs.nl" > CNAME
touch .nojekyll
git add .
git commit -m "Deploy site"
git push --set-upstream origin site -f