1#!/usr/bin/env nix
2#! nix develop --impure --command bash
3
4# Build site
5deno task prod
6
7COMMIT_ID=$(git rev-parse --short HEAD)
8
9echo "Cleaning up /tmp/pages..."
10rm -rf /tmp/pages
11mkdir -p /tmp/pages
12chmod 777 /tmp/pages
13
14echo "Copying built site into /tmp/pages..."
15cp -rT ./_site /tmp/pages
16rm -rf /tmp/pages/.git
17
18echo "Initializing git repo..."
19cd /tmp/pages
20git init -b pages /tmp/pages
21git config user.name "[BOT] PyroNet Actions"
22git config user.email "actions-noreply@pyrox.dev"
23
24echo "Making commit..."
25git add --all
26git commit -m "Deploying $COMMIT_ID to Tangled"
27
28echo "Pushing to Tangled..."
29git remote add origin " git@knot.pyrox.dev:pyrox.dev/blog"
30git push --force origin "pages:pages"
31
32echo "Cleaning up tmpdir..."
33rm -rf /tmp/pages