Skip to content

Commit

Permalink
Create separate deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
evadecker committed Sep 11, 2024
1 parent f240389 commit 8e7c51e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 12 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 1 addition & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

0 comments on commit 8e7c51e

Please sign in to comment.