From 950bb500802782dc099283ebcc058d60868102c4 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Sat, 19 Feb 2022 19:09:20 +0800 Subject: [PATCH] chore: add daily timely logic Signed-off-by: Wing-Kam Wong --- .github/workflows/release-docker.yml | 12 ++++++++++-- .github/workflows/release-nightly-dev.yml | 9 ++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml index be07ca218c..2fdbe58aea 100644 --- a/.github/workflows/release-docker.yml +++ b/.github/workflows/release-docker.yml @@ -25,6 +25,10 @@ on: description: "Target Environment" required: true type: string + isDaily: + description: "Is it triggered by daily schedule" + required: true + type: string secrets: DOCKERHUB_USERNAME: required: true @@ -45,11 +49,15 @@ jobs: run: | DOCKER_REPOSITORY=nocodb if [[ ${{ github.event.inputs.targetEnv || inputs.targetEnv }} == 'DEV' ]]; then - DOCKER_REPOSITORY=${DOCKER_REPOSITORY}-daily + if [[ ${{ inputs.isDaily || 'N' }} == 'Y' ]]; then + DOCKER_REPOSITORY=${DOCKER_REPOSITORY}-daily + else + DOCKER_REPOSITORY=${DOCKER_REPOSITORY}-timely + fi fi echo "::set-output name=DOCKER_REPOSITORY::${DOCKER_REPOSITORY}" echo ${DOCKER_REPOSITORY} - # - name: Verifiy + # - name: Verify # run : | # echo ${{ steps.get-docker-repository.outputs.DOCKER_REPOSITORY }} - name: Checkout diff --git a/.github/workflows/release-nightly-dev.yml b/.github/workflows/release-nightly-dev.yml index 71450bc3d9..8485655feb 100644 --- a/.github/workflows/release-nightly-dev.yml +++ b/.github/workflows/release-nightly-dev.yml @@ -27,16 +27,22 @@ jobs: CURRENT_DATE=$(date +"%Y%m%d") CURRENT_TIME=$(date +"%H%M") TAG_NAME=${CURRENT_DATE} + IS_DAILY='Y' # Set the tag if [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then TAG_NAME=${TAG_NAME}-${CURRENT_TIME} + IS_DAILY='N' fi echo "::set-output name=NIGHTLY_BUILD_TAG::${TAG_NAME}" + echo "::set-output name=IS_DAILY::${IS_DAILY}" # Verify the tag - name: verify-tag - run: echo ${{ steps.tag-step.outputs.NIGHTLY_BUILD_TAG }} + run: | + echo ${{ steps.tag-step.outputs.NIGHTLY_BUILD_TAG }} + echo ${{ steps.tag-step.outputs.IS_DAILY }} outputs: nightly_build_tag: ${{ steps.tag-step.outputs.NIGHTLY_BUILD_TAG }} + is_daily: ${{ steps.tag-step.outputs.IS_DAILY }} # Build frontend and backend and publish to npm release-npm: needs: set-tag @@ -54,6 +60,7 @@ jobs: with: tag: ${{ needs.set-tag.outputs.nightly_build_tag }} targetEnv: ${{ github.event.inputs.targetEnv || 'DEV' }} + isDaily: ${{ needs.set-tag.outputs.is_daily }} secrets: DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}" DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"