Skip to content

trigger

trigger #1047

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI-MAIN
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
repository_dispatch:
types: [trigger]
workflow_dispatch:
inputs:
BRANCH:
description: Hkube branch to clone (e.g. master, release_v1_3)
required: true
default: master
TAG:
description: release-manager tag to get
required: false
FROZEN_VERSION:
description: if 'true' creates a frozen version. If false creates a dev version
required: true
default: 'false'
DEPLOY:
description: if 'true' deploys to cd cluster
required: true
default: 'false'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- uses: actions/setup-node@v1
with:
node-version: 14.x
# disable lint for now because of https://github.com/helm/helm/issues/8615
# - run: helm lint hkube/
- run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: envs
run: |
if [[ $BRANCH = "main" ]]; then
echo changing $BRANCH to master
export BRANCH="master"
fi
echo BRANCH=${BRANCH:-master} >> $GITHUB_ENV
echo FROZEN_VERSION=${FROZEN_VERSION:-false} >> $GITHUB_ENV
echo TAG=$TAG >> $GITHUB_ENV
echo DEPLOY=$DEPLOY >> $GITHUB_ENV
env:
TAG: '${{ github.event.client_payload.TAG || github.event.inputs.TAG }}'
BRANCH: '${{ github.event.client_payload.BRANCH || github.event.inputs.BRANCH }}'
FROZEN_VERSION: '${{ github.event.client_payload.FROZEN_VERSION || github.event.inputs.FROZEN_VERSION }}'
DEPLOY: ${{ github.event.inputs.DEPLOY || 'false' }}
- run: |
git checkout $BRANCH
git status
npm version
npm version patch -m "$(git log -1 --pretty=%B) .... bump version"
echo CHART_TAG=$(git describe --abbrev=0) >> $GITHUB_ENV
- run: git push --follow-tags
- name: chart
run: |
./package.sh
- name: trigger
if: ${{ env.BRANCH == 'master' || env.DEPLOY == 'true' }}
id: trigger
uses: octokit/request-action@v2.x
with:
route: POST /repos/kube-HPC/cd-manager/dispatches
event_type: trigger
client_payload: "{\"version\": \"${{env.CHART_TAG}}\" }"
env:
GITHUB_TOKEN: '${{ secrets.GH_TOKEN }}'