在inrisk.packages.ci.yml
分支中进行推送时,文件tag
中的工作流程会生成realise
和develop
的代码。以下按预期工作。
name: Code Int
on:
push:
paths:
- 'infra/**'
jobs:
ci:
runs-on: ubuntu-latest
steps:
# Checks-out to $GITHUB_WORKSPACE
- uses: actions/checkout@v2
- name: Basic Checks
run: |
whoami
ls -lah
pwd
- uses: actions/setup-node@v1
# Create a new release when on develop which triggers the deployment
- name: Bump version and push tag
if: github.ref == 'refs/heads/develop'
uses: mathieudutour/github-tag-action@v4.5
id: tag_version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
if: github.ref == 'refs/heads/develop'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
draft: false
prerelease: false
文件inrisk.packages.cd.yml
中的以下工作流程,假设在tag
/ realise
为created
/ published
时被触发。
name: Code Deploy
on:
push:
tags:
- 'v*'
release:
types:
- published
- created
- released
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# Checks-out to $GITHUB_WORKSPACE
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Install Yarn
run: npm install -g yarn
- uses: chrislennon/action-aws-cli@v1.1
- name: Install, Build and Deploy
run: |
whoami
ls -lah
pwd
在Code Deploy
Code Int
/ publishes
和created
/ tag
realise
没有触发
但是,当我手动创建realise
/ tag
时,第二个工作流程Code Deploy
被触发