From 0d481ba33b724c1beae71235884d29ac369d0b8e Mon Sep 17 00:00:00 2001 From: Glyphscribe Ety Date: Tue, 10 Nov 2026 22:39:49 -0600 Subject: [PATCH] add workflow --- .gitea/workflows/site.yml | 61 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .gitea/workflows/site.yml diff --git a/.gitea/workflows/site.yml b/.gitea/workflows/site.yml new file mode 100644 index 0000000..530ac7e --- /dev/null +++ b/.gitea/workflows/site.yml @@ -0,0 +1,61 @@ +name: site + +on: + push: + branches: ["main"] + +concurrency: + group: site-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: build + container: + image: node:24-bookworm + steps: + - uses: actions/checkout@v4 + + - name: Install + run: npm ci --ignore-scripts --no-audit --no-fund + + - name: Build + run: npm run build + + - name: Validate + run: npm run check + + - name: Upload + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + uses: actions/upload-artifact@v4 + with: + name: site + path: _site/ + retention-days: 7 + if-no-files-found: error + + deploy: + needs: build + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + runs-on: deploy + defaults: + run: + shell: bash + + steps: + - uses: actions/download-artifact@v4 + with: + name: site + path: _site + + - name: Publish + env: + LIVE: /deploy + run: | + set -euo pipefail + + # dont sync empty builds + test -f _site/index.html + + rsync -trl --delete --chmod=D755,F644 _site/ "$LIVE/" + echo "deployed site." \ No newline at end of file