-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GHA workflows, move migrations to db/migrations and update wra…
…ngler config
- Loading branch information
Showing
4 changed files
with
73 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,54 @@ | ||
name: CI | ||
|
||
on: [push] | ||
# We run CI on every push | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 1 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: oven-sh/setup-bun@v1 | ||
- run: bun install | ||
- run: bun run build | ||
# Automatically cancel running workflows when there's a new one | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
permissions: | ||
contents: read | ||
packages: read | ||
|
||
jobs: | ||
typecheck: | ||
name: Typechecker | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 1 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: oven-sh/setup-bun@v1 | ||
- run: bun install | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v2 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- run: bun install --frozen-lockfile | ||
- run: bun run build | ||
# - run: bun run rr:typegen | ||
- run: bun run typecheck | ||
|
||
test: | ||
tests: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 1 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: oven-sh/setup-bun@v1 | ||
- run: bun install | ||
- run: bun run test:coverage | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v2 | ||
- run: bun install --frozen-lockfile | ||
- run: bun run test | ||
|
||
quality: | ||
name: Code Quality | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 1 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: oven-sh/setup-bun@v1 | ||
- run: bun install | ||
- run: bun run check | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v2 | ||
- run: bun install --frozen-lockfile | ||
- run: bun run quality |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
name: Deploy | ||
|
||
on: [push, workflow_dispatch] | ||
on: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
permissions: | ||
contents: read | ||
deployments: write | ||
packages: read | ||
|
||
jobs: | ||
website: | ||
name: Website | ||
deploy: | ||
name: "Deploy to Cloudflare Workers" | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
deployments: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: oven-sh/setup-bun@v1 | ||
- run: bun install | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v2 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- run: bun install --frozen-lockfile | ||
- run: bun run build | ||
|
||
- uses: cloudflare/pages-action@v1 | ||
- uses: cloudflare/wrangler-action@v3 | ||
with: | ||
apiToken: ${{ secrets.CF_API_TOKEN }} | ||
accountId: ${{ secrets.CF_ACCOUNT_ID }} | ||
projectName: sergiodxa | ||
directory: public | ||
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
preCommands: | | ||
bun run db:migrate ${{ secrets.CLOUDFLARE_DATABASE_NAME }} --remote |
File renamed without changes.
This file contains 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