Browse Source

chore: add daily timely logic

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>
pull/1326/head
Wing-Kam Wong 3 years ago
parent
commit
950bb50080
  1. 12
      .github/workflows/release-docker.yml
  2. 9
      .github/workflows/release-nightly-dev.yml

12
.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

9
.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 }}"

Loading…
Cancel
Save