refactor: github actions & nightly-build

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>
This commit is contained in:
Wing-Kam Wong
2022-02-19 16:10:32 +08:00
parent 79caaa4716
commit 68061a5d29
7 changed files with 170 additions and 19 deletions

View File

@@ -7,13 +7,29 @@ on:
tag:
description: "Docker image tag"
required: true
# Triggered by release-nocodb.yml
targetEnv:
description: "Target Environment"
required: true
type: choice
options:
- DEV
- PROD
# Triggered by release-nocodb.yml / release-nightly-dev.yml
workflow_call:
inputs:
tag:
description: "Docker image tag"
required: true
type: string
targetEnv:
description: "Target Environment"
required: true
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
jobs:
buildx:
@@ -24,6 +40,18 @@ jobs:
matrix:
node-version: [12]
steps:
- name: Get Docker Repository
id: get-docker-repository
run: |
DOCKER_REPOSITORY=nocodb
if [[ ${{ github.event.inputs.targetEnv || inputs.targetEnv }} == 'DEV' ]]; then
DOCKER_REPOSITORY=${DOCKER_REPOSITORY}-dev
fi
echo "::set-output name=DOCKER_REPOSITORY::${DOCKER_REPOSITORY}"
echo ${DOCKER_REPOSITORY}
# - name: Verifiy
# run : |
# echo ${{ steps.get-docker-repository.outputs.DOCKER_REPOSITORY }}
- name: Checkout
uses: actions/checkout@v2
@@ -73,8 +101,8 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache-new
push: true
tags: |
nocodb/nocodb:${{ github.event.inputs.tag || inputs.tag }}
nocodb/nocodb:latest
nocodb/${{ steps.get-docker-repository.outputs.DOCKER_REPOSITORY }}:${{ github.event.inputs.tag || inputs.tag }}
nocodb/${{ steps.get-docker-repository.outputs.DOCKER_REPOSITORY }}:latest
# Temp fix
# https://github.com/docker/build-push-action/issues/252