Skip to content

import tsx, take two (#570) #416

import tsx, take two (#570)

import tsx, take two (#570) #416

Workflow file for this run

name: Deploy
on:
workflow_dispatch: {}
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
id-token: write
packages: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache-dependency-path: |
yarn.lock
'examples/*/yarn.lock'
- run: yarn --frozen-lockfile
- run: yarn build
- run: yarn --frozen-lockfile && yarn build
working-directory: examples/google-analytics
env:
GA_PROPERTY_ID: ${{ vars.GA_PROPERTY_ID }}
GA_CLIENT_EMAIL: ${{ secrets.GA_CLIENT_EMAIL }}
GA_PRIVATE_KEY: ${{ secrets.GA_PRIVATE_KEY }}
- run: yarn --frozen-lockfile && yarn build
working-directory: examples/hello-world
- run: yarn --frozen-lockfile && yarn build
working-directory: examples/pmms
- run: yarn --frozen-lockfile && yarn build
working-directory: examples/plot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: mkdir dist/examples && for i in examples/*; do [ -d $i/dist ] && mv -v $i/dist dist/examples/$(basename $i); done
- uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: cli
directory: dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
# TODO: This doesn't include the examples. How can we fix that?
- name: Deploy to Observable Cloud
run: yarn deploy -m "$(git log -1 --pretty=%s)"
env:
OBSERVABLE_TOKEN: ${{ secrets.OBSERVABLE_API_TOKEN }}