From 92815796e6bde91e53576a845cd16a3cc410a29f Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Sat, 18 Jul 2026 13:47:50 -0500 Subject: [PATCH 1/2] ci: add build gate + promote + release workflows (two-forge) ci.yml: astro build on PR/push to main. promote.yml (Gitea-only): mirror main + tags to Expressive-Tea/green-tea-site. release.yml (GitHub-only): on a v* tag, build and attach dist as a .tar.gz to the GitHub release for the cPanel deploy. Signed-off-by: Diego Resendez --- .github/workflows/ci.yml | 19 +++++++++++++++++++ .github/workflows/promote.yml | 27 +++++++++++++++++++++++++++ .github/workflows/release.yml | 26 ++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/promote.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2cab0a6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: CI + +# Build gate. Runs on both forges (path .github is read by Gitea and GitHub). +on: + pull_request: + branches: [main] + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - run: npm ci + - run: npm run build diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml new file mode 100644 index 0000000..8d1a157 --- /dev/null +++ b/.github/workflows/promote.yml @@ -0,0 +1,27 @@ +name: Promote → GitHub + +# Runs on GITEA ONLY. Mirrors only main + version tags to the public GitHub repo. +on: + push: + branches: [main] + tags: ['v*'] + +jobs: + push-github: + if: ${{ github.server_url != 'https://github.com' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Push main + tags to GitHub + env: + GH_TOKEN: ${{ secrets.GH_PROMOTE_TOKEN }} + run: | + git remote add github "https://x-access-token:${GH_TOKEN}@github.com/Expressive-Tea/green-tea-site.git" + if [ "${{ github.ref_type }}" = "tag" ]; then + git push github "refs/tags/${{ github.ref_name }}" + else + git push github "HEAD:refs/heads/main" + git push github --tags + fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..28949bd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Release → dist.tar.gz + +# Production artifact. Runs on GITHUB ONLY, on a version tag. Builds the static site +# and packages dist/ as a .tar.gz attached to the GitHub release — the cPanel deploy +# pulls that artifact. +on: + push: + tags: ['v*'] + +jobs: + package: + if: ${{ github.server_url == 'https://github.com' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - run: npm ci + - run: npm run build + - name: Package dist/ + run: tar -czf "green-tea-site-${{ github.ref_name }}.tar.gz" -C dist . + - name: Attach to GitHub release + uses: softprops/action-gh-release@v2 + with: + files: green-tea-site-${{ github.ref_name }}.tar.gz From f65fc3742c9dc0a18a261f0029285ef3fc741e1f Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Sat, 18 Jul 2026 13:51:08 -0500 Subject: [PATCH 2/2] ci: bump Node to 22 (Astro 7 requires >=22.12) Signed-off-by: Diego Resendez --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cab0a6..b0f04ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,6 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '20' + node-version: '22' - run: npm ci - run: npm run build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 28949bd..4565167 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '20' + node-version: '22' - run: npm ci - run: npm run build - name: Package dist/