首页

act

设置 act 网络代理

bash
act --env https_proxy=http://192.168.1.4:7897 --env http_proxy=http://192.168.1.4:7897

github actions pnpm 示例

.github/workflows/ci.yaml
需要在 仓库的 Settiongs > Actions > General 中配置允许读写仓库(Read and write permissions)
yaml
name: Build and Deploy on: push: branches: - main jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: node-version: 20 registry-url: https://registry.npmjs.org cache: pnpm - name: Install Dependencies run: pnpm i - name: Build run: pnpm build - name: 部署到自定义分支 uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./dist publish_branch: deploy # 指定目标分支

使用 actions-gh-pages 的注意事项

需要在 仓库的 Settiongs > Actions > General 中配置允许读写仓库(Read and write permissions)

我惯用的命令:

bash
act\ # 不重新拉取镜像(需要之前拉取过) --pull=false\ # 将当前工作目录绑定到容器内,而非复制到容器内(actions脚本可以直接操作外界文件) -b\ # 配置网络代理 --env HTTP_PROXY=http://127.0.0.1:7777 --env HTTPS_PROXY=http://127.0.0.1:7777