Add previews #38
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '**' | |
pull_request: {} | |
env: | |
COLUMNS: 150 | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- run: npm install | |
- uses: pre-commit/action@v3.0.0 | |
with: | |
extra_args: --all-files | |
env: | |
SKIP: no-commit-to-branch | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- run: npm install | |
- run: npm run build | |
- uses: cloudflare/wrangler-action@v3 | |
name: Test monitor-prod build | |
with: | |
command: deploy --dry-run | |
check: | |
if: always() | |
needs: [lint, build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Decide whether the needed jobs succeeded or failed | |
uses: re-actors/alls-green@release/v1 | |
with: | |
jobs: ${{ toJSON(needs) }} | |
deploy-preview: | |
runs-on: ubuntu-latest | |
needs: [check] | |
environment: deploy-preview | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- run: npm install | |
- uses: cloudflare/wrangler-action@v3 | |
name: Deploy pydantic-run-preview | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
command: deploy --env previews --var GITHUB_SHA:${{ github.sha }} | |
deploy: | |
if: "success() && github.ref == 'refs/heads/main'" | |
runs-on: ubuntu-latest | |
needs: [check] | |
environment: deploy-prod | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- run: npm install | |
- uses: cloudflare/wrangler-action@v3 | |
name: Deploy pydantic-run | |
with: | |
apiToken: ${{ secrets.cloudflare_api_token }} | |
command: deploy --var GITHUB_SHA:${{ github.sha }} |