Simplify messaging #152
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
on: [push] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
permissions: | |
contents: read | |
deployments: write | |
name: Deploy to Cloudflare | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# TODO Add cacheing + task skipping when: | |
# Build durations become lengthy - current builds are <30 seconds | |
# Build minutes reaching 2000 min quotas - currently using <5% | |
# Cloudflare Pages reaching 500x deploy quota - currently using <1% | |
# Not needed currently - Cache and diff checks take longer than full workflow completion | |
# https://turbo.build/repo/docs/core-concepts/caching | |
# https://turbo.build/repo/docs/core-concepts/monorepos/skipping-tasks | |
# - name: Cache turbo build setup | |
# uses: actions/cache@v4 | |
# with: | |
# path: .turbo | |
# key: ${{ runner.os }}-turbo-${{ github.sha }} | |
# restore-keys: | | |
# ${{ runner.os }}-turbo- | |
- name: NodeJS setup | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
- name: Disable Turborepo Telemetry | |
run: npx turbo telemetry disable | |
- name: Lint | |
run: npx turbo run lint | |
# Wrangler handles the API build downstream | |
# Thus, only need to build the web app | |
- name: Build | |
run: npx turbo run build --filter=web | |
env: | |
WORKER_URL: ${{ secrets.WORKER_URL }} | |
PROFILES_API_ENDPOINT: ${{ secrets.PROFILES_API_ENDPOINT }} | |
AUTH_PRIVATE_KEY: ${{ secrets.AUTH_PRIVATE_KEY }} | |
WAF_AUTH_VERIFY_KEY: ${{ secrets.WAF_AUTH_VERIFY_KEY }} | |
PUBLIC_ALGOLIA_APP_ID: ${{ secrets.PUBLIC_ALGOLIA_APP_ID }} | |
PUBLIC_ALGOLIA_SEARCH_ONLY_KEY: ${{ secrets.PUBLIC_ALGOLIA_SEARCH_ONLY_KEY }} | |
PUBLIC_ALGOLIA_INDEX_NAME: ${{ secrets.PUBLIC_ALGOLIA_INDEX_NAME }} | |
- name: Publish Webapp | |
uses: cloudflare/pages-action@1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN_PAGES }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
workingDirectory: './apps/web' | |
directory: '.svelte-kit/cloudflare' | |
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }} | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
wranglerVersion: '3' | |
- name: Publish API | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN_WORKERS }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
workingDirectory: './apps/api' |