Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

add GH action to deploy script

Kiran K4fd6a313823a
diff --git a/.github/workflows/deploy-embed-script.yml b/.github/workflows/deploy-embed-script.yml
new file mode 100644
index 0000000000..8333820714
--- /dev/null
+++ b/.github/workflows/deploy-embed-script.yml
@@ -0,0 +1,28 @@
+name: "Deploy embed script"
+
+on:
+ push:
+ branches:
+ - main
+ paths:
+ - "packages/embeds/core/**"
+ workflow_dispatch:
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Install dependencies & build
+ run: pnpm --filter @dub/embed-core build
+
+ # - name: Deploy to Cloudflare Pages
+ # uses: cloudflare/wrangler-action@v3
+ # with:
+ # apiToken: ${{ secrets.CLOUDFLARE_PAGES_API_KEY }}
+ # accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
+ # command: pages deploy dist --project-name=dub-cdn --commit-dirty=true
+ # workingDirectory: packages/embeds/core
+ # packageManager: pnpm
diff --git a/.github/workflows/publish-embed-react.yml b/.github/workflows/publish-embed-react.yml
new file mode 100644
index 0000000000..a2c33052fe
--- /dev/null
+++ b/.github/workflows/publish-embed-react.yml
@@ -0,0 +1,43 @@
+name: Publish `@dub/embed-react`
+
+on:
+ push:
+ branches:
+ - main
+ paths:
+ - "packages/embeds/react/**"
+ release:
+ types: [published]
+ workflow_dispatch:
+
+jobs:
+ publish:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v3
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: "18"
+ registry-url: "https://registry.npmjs.org"
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Build
+ run: pnpm --filter @dub/embed-react build
+
+ - name: Publish
+ run: pnpm --filter @dub/embed-react publish --no-git-checks
+ if: github.event.release.prerelease == false
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+
+ - name: Publish beta
+ run: pnpm --filter @dub/embed-react publish --no-git-checks --tag beta
+ if: github.event.release.prerelease == true
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}