Skip to content

Commit

Permalink
feat: add deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
zhu327 committed Aug 11, 2023
1 parent 767b7bc commit 201daa8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Deploy Worker
on:
push:
pull_request:
repository_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: test
steps:
- uses: actions/checkout@v2
- name: Build & Deploy Worker
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ Please refer to the following documentation for development and deployment.

<https://developers.cloudflare.com/workers/runtime-apis/webassembly/rust/>

**Important**: Before deployment, you need to modify the `vars` configuration in `wrangler.toml` and change `CLIENT_ID` to your UUID.

```toml
[vars]
CLIENT_ID = "c55ba35f-12f6-436e-a451-4ce982c4ec1c"
```

## Setup

To create a `my-project` directory using this template, run:
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ mod websocket {

fn poll_shutdown(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Result<()>> {
let this = self.project();
match this.ws.close(Some(1000), Some("Normal close")) {
match this.ws.close(None, Some("Normal close")) {
Ok(()) => Poll::Ready(Ok(())),
Err(e) => Poll::Ready(Err(Error::new(ErrorKind::Other, e.to_string()))),
}
Expand Down

0 comments on commit 201daa8

Please sign in to comment.