From 01ad2d6af24b5b9c9e4cce5791bea830430fc43f Mon Sep 17 00:00:00 2001 From: klemek Date: Sat, 2 May 2026 16:46:43 +0200 Subject: [PATCH] ci: deploy to stapler --- .github/workflows/deploy.yml | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..ce8f565 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,49 @@ +name: Deploy + +concurrency: + group: deploy-${{ github.ref }} + cancel-in-progress: true + +on: + push: + branches: + - "main" + +jobs: + build: + name: "Build" + runs-on: ubuntu-latest + steps: + - name: Set up Bun + uses: https://github.com/oven-sh/setup-bun@v2 + - name: Checkout repository + uses: actions/checkout@v6 + - name: Install dependencies + run: bun ci + - name: Build project + run: bun run build + - name: Upload production files + uses: actions/upload-artifact@v3 + with: + name: production-files + path: dist/ + + stapler: + name: "Deploy to Stapler" + runs-on: ubuntu-latest + needs: build + if: ${{ vars.STAPLER_TARGET != '' }} + steps: + - name: Download production files + uses: actions/download-artifact@v3 + with: + name: production-files + path: ./dist + - name: Compress production files + run: tar -czC dist -f dist.tar.gz . + - name: Upload to Stapler server + run: | + curl -s -X PUT --data-binary "@dist.tar.gz" \ + -H 'X-Token: ${{ secrets.STAPLER_TOKEN }}' \ + ${{ vars.STAPLER_CURL_ARGS }} \ + ${{ vars.STAPLER_TARGET }}