Fix react-colyseus example #14
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: iframe playground staging deploy | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
environment: staging | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
name: checkout | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: latest | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
# build latest embedded-app-sdk | |
- name: build latest embedded-app-sdk | |
run: | | |
pnpm install && pnpm build | |
# create env file | |
- name: create env file | |
run: | | |
cd examples/iframe-playground | |
echo "${{ secrets.ENV_FILE }}" > .env.staging | |
# build iframe playground client | |
- name: build iframe-playground client | |
run: | | |
cd examples/iframe-playground/packages/client | |
pnpm build-staging | |
# deploy client | |
- name: deploy client | |
uses: cloudflare/wrangler-action@2.0.0 | |
with: | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
accountId: ${{ secrets.CF_ACCOUNT_ID }} | |
preCommands: cd examples/iframe-playground/packages/client | |
command: pages publish --project-name=iframe-playground-staging dist | |
# deploy server | |
- name: deploy server | |
uses: cloudflare/wrangler-action@2.0.0 | |
with: | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
accountId: ${{ secrets.CF_ACCOUNT_ID }} | |
preCommands: | | |
cd examples/iframe-playground/packages/server | |
./handle-wrangler-secrets.sh staging remote | |
command: publish src/index.ts --env staging |