fix: throttle deletion queue drain to 5/sec (#894) #599
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| branches: [next] | |
| workflow_dispatch: | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm -r --filter '!@nostrwatch/gui' build | |
| - name: Create Release Pull Request or Publish | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| version: pnpm changeset version | |
| publish: pnpm changeset publish | |
| title: "chore: version packages" | |
| commit: "chore: version packages" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Create GitHub Releases | |
| if: steps.changesets.outputs.published == 'true' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| echo '${{ steps.changesets.outputs.publishedPackages }}' | \ | |
| node -e " | |
| const pkgs = JSON.parse(require('fs').readFileSync(0,'utf8')); | |
| for (const p of pkgs) { | |
| const tag = p.name.replace('@nostrwatch/','') + '@v' + p.version; | |
| console.log(tag); | |
| } | |
| " | while read -r TAG; do | |
| echo "Creating release: $TAG" | |
| gh release create "$TAG" --title "$TAG" --generate-notes --latest=false || echo "Release $TAG already exists" | |
| done | |
| deploy-gui: | |
| name: Deploy GUI | |
| runs-on: ubuntu-latest | |
| needs: release | |
| if: always() | |
| environment: next.nostr.watch | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm --filter @nostrwatch/gui... build | |
| - run: pnpm --filter @nostrwatch/gui build:seeded | |
| - name: Deploy to nsite | |
| uses: sandwichfarm/nsite-action@v0.1.3 | |
| with: | |
| directory: "./apps/gui/dist" | |
| nbunksec: ${{ secrets.NBUNKSEC }} | |
| relays: | | |
| ${{ env.NSITE_RELAYS }} | |
| servers: | | |
| ${{ env.NSITE_SERVERS }} | |
| purge: true | |
| - name: Deploy to Bunny | |
| uses: R-J-dev/bunny-deploy@v2.1.1 | |
| with: | |
| access-key: ${{ secrets.BUNNY_API_KEY }} | |
| directory-to-upload: "./apps/gui/dist" | |
| storage-endpoint: "https://sg.storage.bunnycdn.com" | |
| storage-zone-name: "nostr-watch" | |
| storage-zone-password: ${{ secrets.BUNNY_STORAGE_ZONE_PASSWORD }} | |
| concurrency: "50" | |
| enable-delete-action: true | |
| enable-purge-pull-zone: true | |
| pull-zone-id: "3313140" | |
| replication-timeout: "15000" | |
| request-timeout: "30000" | |
| retry-limit: "5" |