diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..4f1025e --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,42 @@ +name: Deploy + +on: + push: + tags: + - '*' + +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest + permissions: write-all + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + run_install: false + + - name: Setup Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Deploy Convex and build app + run: npx convex deploy --cmd 'pnpm build' + + - name: Deploy to Cloudflare Pages + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + projectName: 'namesake' + directory: 'dist' + gitHubToken: ${{ secrets.GITHUB_TOKEN }} + branch: main \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3c496bd..926f533 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: release: - name: Release + name: Update changelog and tags runs-on: ubuntu-latest permissions: write-all steps: @@ -36,14 +36,3 @@ jobs: publish: pnpm changeset tag env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Publish to Cloudflare Pages - if: steps.changesets.outputs.hasChangesets == 'false' - uses: cloudflare/pages-action@v1 - with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - projectName: 'namesake' - directory: 'dist' - gitHubToken: ${{ secrets.GITHUB_TOKEN }} - branch: main