Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add cf deployment #59

Merged
merged 10 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/cf-deploy-react.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Cloudflare Deploy React Widget
on:
push:
branches:
- main
paths:
- 'packages/react/**'
pull_request:
branches:
- main
paths:
- 'packages/react/**'

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'yarn'
node-version: 18
- run: corepack enable
- run: yarn set version stable
- run: yarn install --immutable
- run: yarn run lint:react-widget
- run: yarn run build:react-widget

- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: sygma-react-widget
directory: ./packages/react/build
branch: main
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/cf-deploy-widget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Cloudflare Deploy Widget
on:
push:
branches:
- main
paths:
- 'packages/widget/**'
pull_request:
branches:
- main
paths:
- 'packages/widget/**'

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'yarn'
node-version: 18
- run: corepack enable
- run: yarn set version stable
- run: yarn install --immutable
- run: yarn run lint
- run: yarn run build

- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: sygma-widget
directory: ./packages/widget/build
branch: main
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"examples/*"
],
"engines": {
"node": ">=16.0.0"
"node": ">=18.10.0"
},
"devDependencies": {
"@chainsafe/eslint-config": "^2.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "LGPL-3.0-or-later",
"type": "module",
"dependencies": {
"@lit-labs/react": "2.0.3"
"@lit-labs/react": "2.1.2"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes done to trigger the react workflow

},
"peerDependencies": {
"react": ">=17",
Expand Down
1 change: 1 addition & 0 deletions packages/widget/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ build

/bundle
/bundle/*

23 changes: 16 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@buildwithsygma/sygmaprotocol-react-widget@workspace:packages/react"
dependencies:
"@lit-labs/react": "npm:2.0.3"
"@lit-labs/react": "npm:2.1.2"
peerDependencies:
react: ">=17"
react-dom: ">=17"
Expand Down Expand Up @@ -1504,12 +1504,12 @@ __metadata:
languageName: node
linkType: hard

"@lit-labs/react@npm:2.0.3":
version: 2.0.3
resolution: "@lit-labs/react@npm:2.0.3"
peerDependencies:
"@types/react": 17 || 18
checksum: 4fb12580e474cd2f68d5dc4f1a9a95ef9e1c3fde281ae89b2a93d19e1ab7bbb46193474becd6270feb5b7345064024a83e3d0f15c9065dc96b22343efd945db1
"@lit-labs/react@npm:2.1.2":
version: 2.1.2
resolution: "@lit-labs/react@npm:2.1.2"
dependencies:
"@lit/react": "npm:^1.0.0"
checksum: 57862918da988114555c4b736d684200534a0e6e97c97b753db27d7ba3a953b23ba9730132c00e314551ccffb7ed666e5d3351688b2ec0515f59c7f793584f4c
languageName: node
linkType: hard

Expand All @@ -1529,6 +1529,15 @@ __metadata:
languageName: node
linkType: hard

"@lit/react@npm:^1.0.0":
version: 1.0.2
resolution: "@lit/react@npm:1.0.2"
peerDependencies:
"@types/react": 17 || 18
checksum: 5abc4d7df2f9c6fd72ffc4eb7f43e363216a50d7a9adae215e1452615ef2a96e6879650621bf95a1acfd41561cc12ef0114ed21b8de3ca9a377f76fb0fdf4008
languageName: node
linkType: hard

"@lit/reactive-element@npm:^1.6.2 || ^2.0.0, @lit/reactive-element@npm:^2.0.0":
version: 2.0.0
resolution: "@lit/reactive-element@npm:2.0.0"
Expand Down
Loading