From 1d63ab69af046d1a3ea5b21186ff14bc3b692e05 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Sat, 20 Dec 2025 20:56:26 +0100 Subject: [PATCH] ffs --- .forgejo/workflows/playing-around.yaml | 48 +++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/playing-around.yaml b/.forgejo/workflows/playing-around.yaml index bfee772..24789ae 100644 --- a/.forgejo/workflows/playing-around.yaml +++ b/.forgejo/workflows/playing-around.yaml @@ -1,9 +1,47 @@ -on: [push] +on: + push: + branches: + - stage jobs: - print-content: + build: runs-on: docker + environment: ${{ github.ref_name }} + steps: - - name: checkout code + - name: Checkout code uses: actions/checkout@v4 - - name: list directory contents - run: ls -la + + - name: Setup Node.js + uses: https://code.forgejo.org/actions/setup-node@v4 + with: + node-version: "22" + + - name: Install dependencies + run: npm ci + + - name: Build Astro project + run: npm run build + + - name: Deploy dist to dist-${{ github.ref_name }} + run: | + git config user.name "forgejo-actions[bot]" + git config user.email "forgejo-actions[bot]@users.noreply.local" + + git checkout --orphan temp-build + git rm -rf . + + git add dist + git commit -m "Update dist/ [skip ci]" + + git push \ + https://x-access-token:${{ secrets.GITHUB_TOKEN }}@${{ github.server_url#https:// }}/{{ github.repository }} \ + temp-build:dist-${{ github.ref_name }} \ + --force + + - name: Trigger deployment webhook + env: + DEPLOY_WEBHOOK: ${{ secrets.COOLIFY_STAGE_DEPLOY_WEBHOOK }} + DEPLOY_TOKEN: ${{ secrets.COOLIFY_STAGE_DEPLOY_TOKEN }} + run: | + curl -v "$DEPLOY_WEBHOOK" \ + --header "Authorization: Bearer $DEPLOY_TOKEN"