From 547aee3de36180ec8f8d8328795b43dd9680d689 Mon Sep 17 00:00:00 2001 From: June Date: Sat, 26 Jul 2025 16:31:32 +0200 Subject: [PATCH] wip: ci: factor out deployment into separate steps for better org. --- .forgejo/workflows/deploy.yaml | 51 ++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index a2f1716..4b6687f 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -79,8 +79,55 @@ jobs: run: | rsync -v -r --delete -e "ssh -i deploykey.priv -o 'UserKnownHostsFile ./known_hosts'" public/ ccchh-website-deploy@public-web-static-intern.hamburg.ccc.de:/var/www/hamburg.ccc.de/ - - uses: actions/upload-artifact@v3 - if: github.event_name == 'pull_request' + - name: Upload the website build as an artifact + uses: actions/upload-artifact@v3 with: name: website-build path: public/ + + deploy-prod: + if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref_name == 'main' + needs: + - build + runs-on: docker + container: + image: code.forgejo.org/oci/node:22-bookworm + steps: + - name: Download the website build artifact + uses: actions/download-artifact@v3 + with: + name: website-build + path: website-build + + - name: Install packages + run: | + apt update + # For uploading. + apt install -y rsync + + + - name: debugging + run: | + ls -la + echo "website-build:" + ls -la website-build + + deploy-staging: + if: github.event_name == 'pull_request' + needs: + - build + runs-on: docker + container: + image: code.forgejo.org/oci/node:22-bookworm + steps: + - name: Download the website build artifact + uses: actions/download-artifact@v3 + with: + name: website-build + path: website-build + + - name: Install packages + run: | + apt update + # For uploading. + apt install -y rsync