Skip to content

Dev

Dev #1143

Workflow file for this run

name: MAIN
on:
push:
tags:
- grader-service-*
- grader-convert-*
- grader-labextension-*
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
init:
runs-on: ubuntu-latest
outputs:
changeDirs: ${{ steps.outputStep.outputs.changeDirs }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get changed dirs # To check if any files changed in a directory
id: changeDirsStep
uses: tj-actions/[email protected]
with:
dir_names: true
files: |
**/*
- id: outputStep
run: echo "::set-output name=changeDirs::${{ steps.changeDirsStep.outputs.all_changed_files }}"
# ON CHANGED FILES
build_grader-service:
uses: ./.github/workflows/build_service.yml
needs: init
if: contains(needs.init.outputs.changeDirs, 'grader_service')
dockerize_grader-service:
needs: build_grader-service
uses: ./.github/workflows/docker_service.yml
build_labextension:
uses: ./.github/workflows/build_labextension.yml
needs: init
if: contains(needs.init.outputs.changeDirs, 'grader_labextension')
dockerize_labextension:
needs: build_labextension
uses: ./.github/workflows/docker_labextension.yml
secrets: inherit
build_convert:
needs: init
if: contains(needs.init.outputs.changeDirs, 'grader_convert')
uses: ./.github/workflows/build_convert.yml
release_helm:
needs: init
if: contains(needs.init.outputs.changeDirs, 'charts/grader-service') && startsWith(github.ref, 'refs/tags/grader-service') && !startsWith(github.ref, 'refs/tags/grader-service-helm')
uses: ./.github/workflows/publish_helm.yml
secrets: inherit
# docs:
# runs-on: ubuntu-latest
# steps:
# - uses: ./.github/workflows/reusable/build_docs
# ONLY ON MERGE SUCCEED
pre-release:
runs-on: ubuntu-latest
needs:
- dockerize_grader-service
- dockerize_labextension
- build_convert
if: always() && github.event.pull_request.merged == true && contains(needs.*.result, 'success') && !(contains(needs.*.result, 'failure'))
steps:
- name: TODO use correct version tags for pre-release
run: echo 'TODO use correct version tags for pre-release'
# ONLY ON TAGS
release_grader-service:
needs: dockerize_grader-service
if: startsWith(github.ref, 'refs/tags/grader-service')
uses: ./.github/workflows/publish_service.yml
secrets: inherit
release_labextension:
needs: build_labextension
if: startsWith(github.ref, 'refs/tags/grader-labextension')
uses: ./.github/workflows/publish_labextension.yml
secrets: inherit
release_convert:
needs: build_convert
if: startsWith(github.ref, 'refs/tags/grader-convert')
uses: ./.github/workflows/publish_convert.yml
secrets: inherit