Skip to content

Commit

Permalink
update action 一键部署
Browse files Browse the repository at this point in the history
  • Loading branch information
Fankouzu committed Jul 2, 2024
1 parent efeb9bf commit 4d07db2
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 27 deletions.
49 changes: 22 additions & 27 deletions docs/SolanaAction/001.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,47 +545,42 @@ export const GET = async (req: Request) => {
};
```
这样的代码就可以按照规范显示出3个发送SOL的按钮,同时还会显示一个输入框,让用户可以自己定制发送SOL的数额
这样的代码就可以按照规范显示出 3 个发送 SOL 的按钮,同时还会显示一个输入框,让用户可以自己定制发送 SOL 的数额
[捐款action的完整代码在这里](https://github.com/Fankouzu/solana-action/blob/main/src/app/api/actions/donate/route.ts)
[捐款 action 的完整代码在这里](https://github.com/Fankouzu/solana-action/blob/main/src/app/api/actions/donate/route.ts)
修改好代码之后提交GitHub
修改好代码之后提交 GitHub
```sh
git add .
git commit -m "add donate"
git push
```
提交代码后vercel会自动部署前端,稍微等待几秒钟,修改就会在前端生效,这是你就拥有了一个新的捐款的Solana action链接<https://solana-action.vercel.app/api/actions/donate>
提交代码后 vercel 会自动部署前端,稍微等待几秒钟,修改就会在前端生效,这是你就拥有了一个新的捐款的 Solana action 链接<https://solana-action.vercel.app/api/actions/donate>
将链接提交到<https://dial.to/>创建捐款的Blink
将链接提交到<https://dial.to/>创建捐款的 Blink
![blink-donate](/blink-donate.png)
## 6.使用模版定制自己的
## 6.使用模版一键部署 Solana Action
1. 打开[我的GitHub仓库](https://github.com/Fankouzu/solana-action/tree/main/cloudflare-workers-template),Fork到自己的GitHub,然后点击模版部署按钮
1. 注册[GitHub](https://github.com/)和[Vercel](https://vercel.com/)
![cloudflare-apikey](/cloudflare-apikey1.png)
2. 打开[我的 GitHub 仓库](https://github.com/Fankouzu/solana-action) 点击 README 中的 Deploy 按钮
![deploy-action-button](/deploy-action-button.png)
3. 页面这是跳转到了 Vercel,在这里首先选择一个仓库名称,这个名称不影响运行,只要和自己的其它仓库名不重复即可,默认仓库名称为:my-blink-donate-action,不修改也可以,然后点击 Create 按钮
![deploy-action-repo-name](/deploy-action-repo-name.png)
4. 创建仓库之后接下来需要设置环境变量,这里包括收款地址,金额,卡片标题简介头像,设置好之后点击 Deploy 按钮
![deploy-action-config](/deploy-action-config.png)
5. 然后 Vercel 将自动运行部署,等待几分钟
2. 在打开的页面中链接GitHub,之后需要输入用户id和api token
![cloudflare-apikey2](/cloudflare-apikey2.png)
3. 用户id在这里复制
![cloudflare-apikey2](/cloudflare-apikey3.png)
4. api token[在这个地址](https://dash.cloudflare.com/profile/api-tokens)创建,创建时选择通过模版创建Edit Cloudflare Workers,创建时Account选择all,zone选择all
![cloudflare-apikey4](/cloudflare-apikey4.png)
5. 有了用户id和api token之后粘贴继续下一步,点击部署
![cloudflare-apikey5](/cloudflare-apikey5.png)
6. 部署完成后,在cloudflareworks & pages页面中选择对应的works,然后点击右上角的访问按钮
![cloudflare-apikey6](/cloudflare-apikey6.png)
- 部署中
![deploy-action-deploying](/deploy-action-deploying.png)
- 部署成功
![deploy-action-finnish](/deploy-action-finnish.png)
6. 部署成功后,访问 `https://<你的仓库名>.vercel.com/api/actions/donate` 看到 json 返回结果就代表部署正确,并且核对你输入的环境变量
- [演示地址](https://my-blink-donate-action.vercel.app/api/actions/donate)
7. 访问`https://dial.to/?action=solana-action%3Ahttps%3A%2F%2F<你的仓库名>.vercel.app%2Fapi%2Factions%2Fdonate` 可以看到你的 Blink 链接
- [演示地址](https://dial.to/?action=solana-action:https://my-blink-donate-action.vercel.app/api/actions/donate)
Binary file removed docs/public/cloudflare-apikey1.png
Binary file not shown.
Binary file removed docs/public/cloudflare-apikey2.png
Binary file not shown.
Binary file removed docs/public/cloudflare-apikey3.png
Binary file not shown.
Binary file removed docs/public/cloudflare-apikey4.png
Binary file not shown.
Binary file removed docs/public/cloudflare-apikey5.png
Binary file not shown.
Binary file removed docs/public/cloudflare-apikey6.png
Binary file not shown.
Binary file added docs/public/deploy-action-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/deploy-action-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/deploy-action-deploying.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/deploy-action-finnish.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/deploy-action-repo-name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4d07db2

Please sign in to comment.