npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@xsin/x.deploy

v1.4.13

Published

基于 Shell 脚本和 CI/CD 工作流的自动化部署解决方案,支持应用部署至阿里云多台主机、 Certbot 证书生成和自动续期、Nginx 配置、Docker 容器管理等。

Downloads

52

Readme

X.Deploy

基于 Shell 脚本和 CI/CD 工作流的自动化部署解决方案。

  • 目标用户: 开发者、运维工程师
  • 核心价值: 简化应用程序的部署流程,支持多环境、多服务器、Docker 集成、NGINX 配置、SSL 证书管理等功能。

使用方法

安装

使用 bun 安装:

bun add -g @aispin/x.deploy

或使用 npm 安装:

npm install -g @aispin/x.deploy

初始化项目

在项目根目录下初始化 x.deploy:

x.deploy init

这将创建 .xdeploy 目录并生成默认的生产环境配置。

添加其他环境(可选)

添加测试环境:

x.deploy init -e test

配置环境

初始化后,编辑环境配置文件:

vim .xdeploy/production.yml  # 或其他环境的配置文件

注意:根据需要修改 .xdeploy 目录下的其他配置文件,确认无误后将 XDP_DEPLOY_READY 设置为 true

Github Token 配置

对于基于 Github Actions 工作流进行部署的项目,需要设置 XDP_GITHUB_OWNERXDP_GITHUB_REPOXDS_GITHUB_TOKEN 三个变量(密钥)。

XDS_GITHUB_TOKEN 需要有读写 Github 环境变量的权限

Fine-grained access tokens for "Create or update an environment"
This endpoint works with the following fine-grained token types:

- GitHub App user access tokens
- GitHub App installation access tokens
- Fine-grained personal access tokens

The fine-grained token must have the following permission set:

"Administration" repository permissions (write)

构建生成部署文件

生成或更新指定环境的工作流、配置及脚本文件:

x.deploy build -e production  # 默认为 production 环境

这将根据配置文件生成相应的部署文件和 GitHub Actions 工作流文件。

使用 GitHub Actions 部署

配置完成后,推送代码到 GitHub 仓库即可触发自动部署流程,或手动在 GitHub Actions 页面触发工作流。

更新 .gitignore 文件

添加以下内容至 .gitignore,避免机密和无用文件传到 git 仓库。

# X.Deploy
.xdeploy/templates
.xdeploy/*.yml
.xdeploy/.backup

项目文档

Pkg Registry

pkg.pr.new

常见问题

xdeploy-init-server 工作流出现 Connection Time out 错误

fatal: unable to access 'https://github.com/aiblaze/linux.init.git/': Failed to connect to github.com port 443: Connection timed out

解决办法:

通过覆盖 GitHub 域名的 DNS 解析,绕过污染或延迟高的 DNS 服务器:

  1. 获取最新 IP 地址

使用工具(如 IPAddress.com)分别查询以下域名当前最快的 IP:

github.com、api.github.com、assets-cdn.github.com、github.global.ssl.fastly.net。

  1. 修改 hosts 文件

在阿里云主机上执行:

sudo vim /etc/hosts

添加如下内容(示例 IP 需替换为查询到的最新值):

140.82.114.4    github.com
140.82.114.5    api.github.com
185.199.108.153 assets-cdn.github.com
199.232.69.194  github.global.ssl.fastly.net
  1. 刷新 DNS 缓存
sudo systemctl restart NetworkManager  # AlmaLinux

参考文章:https://developer.aliyun.com/article/1077240