-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create sdk-playground-production.yml
Signed-off-by: Alexia <96691787+kitsunebunny@users.noreply.github.com>
- Loading branch information
1 parent
5a2223c
commit 55916fe
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: sdk playground production deploy | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
environment: production | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
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/sdk-playground | ||
echo "${{ secrets.ENV_FILE }}" > .env.production | ||
# build sdk playground client | ||
- name: build sdk-playground client | ||
run: | | ||
cd examples/sdk-playground/packages/client | ||
pnpm build | ||
# deploy client | ||
- name: deploy client | ||
uses: cloudflare/wrangler-action@v3.5.0 | ||
with: | ||
apiToken: ${{ secrets.CF_API_TOKEN }} | ||
accountId: ${{ secrets.CF_ACCOUNT_ID }} | ||
preCommands: cd examples/sdk-playground/packages/client | ||
command: pages publish --project-name=sdk-playground dist | ||
|
||
# deploy server | ||
- name: deploy server | ||
uses: cloudflare/wrangler-action@v3.5.0 | ||
with: | ||
apiToken: ${{ secrets.CF_API_TOKEN }} | ||
accountId: ${{ secrets.CF_ACCOUNT_ID }} | ||
preCommands: | | ||
cd examples/sdk-playground/packages/server | ||
./handle-wrangler-secrets.sh production remote | ||
command: publish src/index.ts --env production |