docs: simplify database overview (#78) #84
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: Main | |
| on: | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| verify: | |
| name: Verify | |
| # Granted at the call site: a called workflow may not request more than the calling job holds. | |
| permissions: | |
| contents: read | |
| uses: ./.github/workflows/verify.yml | |
| changesets: | |
| name: Changesets | |
| needs: verify | |
| permissions: | |
| contents: write | |
| id-token: write | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| uses: ./.github/actions/install-dependencies | |
| - name: PR or publish | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| commit: 'chore: version packages' | |
| publish: pnpm changeset:publish | |
| title: 'chore: version packages' | |
| version: pnpm changeset:version | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Update Action tag | |
| if: steps.changesets.outputs.published == 'true' | |
| run: | | |
| major="$(node -p "require('./package.json').version.split('.')[0]")" | |
| tag="v$major" | |
| git tag --annotate --force "$tag" "$GITHUB_SHA" --message "$tag" | |
| git push --force origin "refs/tags/$tag" | |
| - name: Release standalone binaries | |
| if: steps.changesets.outputs.published == 'true' | |
| uses: wevm/incur/release@main | |
| deploy: | |
| name: Deploy | |
| needs: verify | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install dependencies | |
| uses: ./.github/actions/install-dependencies | |
| # The queues are declared in `wrangler.jsonc`, so they have to exist before the Worker binding | |
| # resolves. Creating one that is already there is an error, which is what the `|| true` is for. | |
| - name: Deploy the app | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| packageManager: pnpm | |
| preCommands: | | |
| wrangler queues create frog-webhooks || true | |
| wrangler queues create frog-webhooks-dlq || true | |
| workingDirectory: app | |
| # Separate, and after, because the action uploads secrets before it deploys: on the very first run | |
| # there would be no Worker to attach them to. The command here is a dry run so this step only ever | |
| # costs the upload. | |
| - name: Sync the app secrets | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| command: deploy --dry-run | |
| packageManager: pnpm | |
| secrets: | | |
| APP_ID | |
| PRIVATE_KEY | |
| WEBHOOK_SECRET | |
| workingDirectory: app | |
| env: | |
| APP_ID: ${{ secrets.FROG_APP_ID }} | |
| PRIVATE_KEY: ${{ secrets.FROG_PRIVATE_KEY }} | |
| WEBHOOK_SECRET: ${{ secrets.FROG_WEBHOOK_SECRET }} |