Browse Source

fix: docker version & enable leave-comment

pull/1926/head
Wing-Kam Wong 2 years ago
parent
commit
b1aefa9927
  1. 14
      .github/workflows/release-docker.yml
  2. 5
      .github/workflows/release-nightly-dev.yml
  3. 30
      .github/workflows/release-pr.yml

14
.github/workflows/release-docker.yml

@ -29,6 +29,10 @@ on:
description: "Is it triggered by daily schedule"
required: false
type: string
currentVersion:
description: "The current NocoDB version"
required: false
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
@ -48,7 +52,11 @@ jobs:
id: get-docker-repository
run: |
DOCKER_REPOSITORY=nocodb
DOCKER_BUILD_TAG=${{ github.event.inputs.tag || inputs.tag }}
if [[ ${{ github.event.inputs.targetEnv || inputs.targetEnv }} == 'DEV' ]]; then
if [[ ${{ github.event.inputs.currentVersion || inputs.currentVersion }} != '' ]]; then
DOCKER_BUILD_TAG=${{ github.event.inputs.currentVersion || inputs.currentVersion }}-${{ github.event.inputs.tag || inputs.tag }}
fi
if [[ ${{ inputs.isDaily || 'N' }} == 'Y' ]]; then
DOCKER_REPOSITORY=${DOCKER_REPOSITORY}-daily
else
@ -56,7 +64,9 @@ jobs:
fi
fi
echo "::set-output name=DOCKER_REPOSITORY::${DOCKER_REPOSITORY}"
echo "::set-output name=DOCKER_BUILD_TAG::${DOCKER_BUILD_TAG}"
echo ${DOCKER_REPOSITORY}
echo ${DOCKER_BUILD_TAG}
- name: Checkout
uses: actions/checkout@v2
@ -118,13 +128,13 @@ jobs:
uses: docker/build-push-action@v2
with:
context: ${{ env.working-directory }}
build-args: NC_VERSION=${{ github.event.inputs.tag || inputs.tag }}
build-args: NC_VERSION=${{ steps.get-docker-repository.outputs.DOCKER_BUILD_TAG }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
push: true
tags: |
nocodb/${{ steps.get-docker-repository.outputs.DOCKER_REPOSITORY }}:${{ github.event.inputs.tag || inputs.tag }}
nocodb/${{ steps.get-docker-repository.outputs.DOCKER_REPOSITORY }}:${{ steps.get-docker-repository.outputs.DOCKER_BUILD_TAG }}
nocodb/${{ steps.get-docker-repository.outputs.DOCKER_REPOSITORY }}:latest
# Temp fix

5
.github/workflows/release-nightly-dev.yml

@ -28,6 +28,8 @@ jobs:
CURRENT_TIME=$(date +"%H%M")
TAG_NAME=${CURRENT_DATE}-${CURRENT_TIME}
IS_DAILY='Y'
# Get current version
CURRENT_VERSION=$(basename $(curl -fs -o/dev/null -w %{redirect_url} https://github.com/nocodb/nocodb/releases/latest))
# Set the tag
if [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then
TAG_NAME=${TAG_NAME}
@ -40,9 +42,11 @@ jobs:
run: |
echo ${{ steps.tag-step.outputs.NIGHTLY_BUILD_TAG }}
echo ${{ steps.tag-step.outputs.IS_DAILY }}
echo ${{ steps.tag-step.outputs.CURRENT_VERSION }}
outputs:
nightly_build_tag: ${{ steps.tag-step.outputs.NIGHTLY_BUILD_TAG }}
is_daily: ${{ steps.tag-step.outputs.IS_DAILY }}
current_version: ${{ steps.tag-step.outputs.CURRENT_VERSION }}
# Build frontend and backend and publish to npm
release-npm:
needs: set-tag
@ -58,6 +62,7 @@ jobs:
needs: [set-tag, release-npm]
uses: ./.github/workflows/release-docker.yml
with:
currentVersion: ${{ needs.set-tag.outputs.current_version }}
tag: ${{ needs.set-tag.outputs.nightly_build_tag }}
targetEnv: ${{ github.event.inputs.targetEnv || 'DEV' }}
isDaily: ${{ needs.set-tag.outputs.is_daily }}

30
.github/workflows/release-pr.yml

@ -64,6 +64,7 @@ jobs:
needs: [release-npm, set-tag]
uses: ./.github/workflows/release-docker.yml
with:
currentVersion: ${{ needs.set-tag.outputs.current_version }}
tag: ${{ needs.set-tag.outputs.target_tag }}
targetEnv: 'DEV'
isDaily: 'N'
@ -71,25 +72,24 @@ jobs:
DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}"
DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"
leave-comment:
runs-on: 'ubuntu-latest'
needs: [release-docker, set-tag]
steps:
- run: |
echo docker run -d -p 8888:8080 nocodb-timely:${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}
# Uncomment it after testing
# leave-comment:
# runs-on: 'ubuntu-latest'
# needs: [release-docker, set-tag]
# steps:
# - uses: peter-evans/commit-comment@v2
# with:
# body: |
# The PR changes have been deployed. Pleae run the following command to verify:
# ```
# docker run -d -p 8888:8080 nocodb-timely:${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}
# ```
# - run: |
# echo docker run -d -p 8888:8080 nocodb/nocodb-timely:${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}
leave-comment:
runs-on: 'ubuntu-latest'
needs: [release-docker, set-tag]
steps:
- uses: peter-evans/commit-comment@v2
with:
body: |
The PR changes have been deployed. Pleae run the following command to verify:
```
docker run -d -p 8888:8080 nocodb/nocodb-timely:${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}
```
# if-merged:
# if: github.event.pull_request.merged == true

Loading…
Cancel
Save