on.push.<branches|tags|branches-ignore|tags-ignore> When using thepushevent, you can configure a workflow to run on specific branches or tags. Use thebranchesfilter when you want to include branch name patterns or when you want to both include and exclude branch names patterns. Use the...
配置在仓库设置里面的 secrets 菜单栏中,使用secrets.XXX 读取本仓库的环境变量 一个GitHub Actions demo 结合上面的概念以及注释理解 name:DeployGitHubPages# 触发条件:在 push 到 master 分支后on:push:branches:-master# 任务jobs:build-and-deploy:# 服务器环境:最新版 Ubunturuns-on:ubuntu-lateststeps:# 拉...
# 使用一个Actions 使用uses关键字,with表明参数-name:Setup Nodeuses:actions/setup-node@v1with:node-version:'10.x'# 使用多路径的缓存帮助构建-name:Cache multiple pathsuses:actions/cache@v2with:path:|~/cache!~/cache/exclude**/node_moduleskey:${{runner.os}}-${{hashFiles('**/lockfiles')}}...
name:My GitHub Actions on on字段指定触发 workflow 的条件,通常是某些事件。上面代码指定,push事件触发 workflow。 on字段也可以是事件的数组。 代码语言:javascript 复制 # push时触发 workflowon:push # 也可以是一系列触发的数组,push 或 pull_request时触发on:[push,pull_request]# main分支push时触发on:push...
name:Example workflow for Codecovon:[push]jobs:run:runs-on:${{ matrix.os }}strategy:matrix:os:[ubuntu-latest, macos-latest, windows-latest]env:OS:${{ matrix.os }}PYTHON:'3.10'steps: -uses:actions/checkout@main-name:Setup Pythonuses:actions/setup-python@mainwith:python-version:3.10-name...
GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly. - peaceiris/actions-gh-pages
name:GreetEveryone# This workflow is triggered on pushes to the repository.on:[push]jobs:your_job_id:# Job name is Greetingname:Greeting# This job runs on Linuxruns-on:ubuntu-latest steps:# This step uses GitHub's hello-world-javascript-action: https://github.com/actions/hello-world-javasc...
on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest # 使用ubuntu系统镜像运行自动化脚本 steps: # 自动化步骤 #下载代码仓库 - uses: actions/checkout@v1 # 使用action库,安装node - name: use Node.js # 使用action库 actions/setup-node安装node ...
首先在仓库 1 的根目录下,创建.github/workflows/main.yml文件,这就是 GitHub Actions 功能的配置文件,用于告诉 GitHub 要做哪些事情,写入以下内容 name: Deploy GitHub Pages # 触发条件:在 push 到 master 分支后 on: push: branches: - master
on: push: paths-ignore: - 'docs/**' Example: Including and excluding paths You can not use paths and paths-ignore to filter the same event in a single workflow. If you want to both include and exclude path patterns for a single event, use the paths filter along with the ! character...