Files
act-runner-example/install-act.sh
严浩 4ebd383dfe ci: 添加 Act 部署命令
- 增加了 Act 部署命令以解决潜在的部署问题
- 该命令配置了网络模式、 artifact 和缓存服务器地址等参数
2025-09-01 12:27:49 +08:00

44 lines
1.5 KiB
Bash

#!/bin/bash
# https://nektosact.com/usage/index.html
act --version
brew install act
# https://github.com/nektos/act/issues/1866#issuecomment-2250414551
act --network="bridge" --artifact-server-addr="host.docker.internal" --cache-server-addr="host.docker.internal" --workflows=.github/workflows/ci-cd.yaml --pull=false --secret-file=.env.secrets.local --job=deploy
act --workflows .gitea/workflows/docker-image.yml -P ubuntu-arm64=gitea/runner-images:ubuntu-latest --pull=false --secret-file my.secrets
# curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
# ~/.actrc # https://nektosact.com/usage/index.html#configuration-file
# #############################
act --list
act --list pull_request
# Run the default (`push`) event:
act
# Run a specific event:
act pull_request
# Run a specific job:
act --job build
# === Secrets ===
act -s GITHUB_TOKEN="$(gh auth token)"
# Run a job in a specific workflow (useful if you have duplicate job names)
act -j lint -W .github/workflows/checks.yml --dryrun
# Collect artifacts to the /tmp/artifacts folder:
act --artifact-server-path /tmp/artifacts
# Enable verbose-logging (can be used with any of the above commands)
act -v
# ##########################################################
act --pull=false --container-architecture linux/amd64 -P ubuntu-latest=catthehacker/ubuntu:act-latest --secret-file my.secrets
# https://nektosact.com/usage/index.html#using-event-file-to-provide-complete-event-payload
act --eventpath act-event-file.json