【发布时间】:2020-11-22 23:29:04
【问题描述】:
我想设置我的工作流程以执行以下操作:
- 在任何事件上(拉请求,推任何分支)
- 结帐代码
- 构建项目
- 运行测试
- 为其他作业上传工件
- 仅当主服务器被推送时
- 从以前的作业下载工件
- 推送 GH 页面
- 仅在推送标签时
- 从以前的作业下载工件
- 创建版本
- 将工件上传到版本
在我的.github/workflows 中,on 指令适用于所有工作,因此不适用于我的情况。另一方面,action/upload-artifact 只能在相同的工作流程中工作。
实现上述工作流程的正确方法是什么?
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
with:
submodules: true
- name: Build
run: make all
- uses: actions/upload-artifact@v2
with:
name: build
path: dist/
- name: Deploy to GitHub Pages
filters: # <-----<<<< What I would like to do
branch: master
uses: JamesIves/github-pages-deploy-action@3.5.9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: dist/html
【问题讨论】:
标签: github github-actions