Merge remote-tracking branch 'origin/main'
This commit is contained in:
26
.github/workflows/ui-workflow.yml
vendored
26
.github/workflows/ui-workflow.yml
vendored
@@ -7,6 +7,11 @@ on:
|
|||||||
description: "Docker repository address"
|
description: "Docker repository address"
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
GIT_REVISION_ENV_NAME:
|
||||||
|
description: "Env name for setting git revision"
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: 'REACT_GIT_REVISION'
|
||||||
IS_ECR_PUSH_ENABLED:
|
IS_ECR_PUSH_ENABLED:
|
||||||
description: "Disable pushing to ECR. Default is true."
|
description: "Disable pushing to ECR. Default is true."
|
||||||
required: true
|
required: true
|
||||||
@@ -16,6 +21,11 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: true
|
default: true
|
||||||
|
IMAGE_TAG_ECR:
|
||||||
|
description: "Select image tag for ECR"
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: latest
|
||||||
NODE_VERSION:
|
NODE_VERSION:
|
||||||
description: "Node version to setup. Default is 16."
|
description: "Node version to setup. Default is 16."
|
||||||
required: false
|
required: false
|
||||||
@@ -44,11 +54,18 @@ jobs:
|
|||||||
registry-url: 'https://npm.pkg.github.com'
|
registry-url: 'https://npm.pkg.github.com'
|
||||||
scope: '@arbinahq'
|
scope: '@arbinahq'
|
||||||
|
|
||||||
- run: (rm .npmrc || true) && npm install
|
- name: Add envs
|
||||||
|
run: |
|
||||||
|
echo ${{ inputs.GIT_REVISION_ENV_NAME }}=${{ secrets.SECRET_IMAGE_TAG }} >> .env
|
||||||
|
cat .env
|
||||||
|
|
||||||
|
- name: NPM install packages
|
||||||
|
run: (rm .npmrc || true) && npm install
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.SECRET_GH_TOKEN_CAN_READ_PACKAGES }}
|
NODE_AUTH_TOKEN: ${{ secrets.SECRET_GH_TOKEN_CAN_READ_PACKAGES }}
|
||||||
|
|
||||||
- run: npm run build
|
- name: NPM build
|
||||||
|
run: npm run build
|
||||||
if: ${{ inputs.IS_BUILD_ENABLED }}
|
if: ${{ inputs.IS_BUILD_ENABLED }}
|
||||||
|
|
||||||
- name: Login to ECR
|
- name: Login to ECR
|
||||||
@@ -67,11 +84,12 @@ jobs:
|
|||||||
ECR_REPOSITORY: ${{ inputs.ECR_REPOSITORY }}
|
ECR_REPOSITORY: ${{ inputs.ECR_REPOSITORY }}
|
||||||
IMAGE_TAG: ${{ secrets.SECRET_IMAGE_TAG }}
|
IMAGE_TAG: ${{ secrets.SECRET_IMAGE_TAG }}
|
||||||
BOOT_JAR_NAME: ${{ inputs.BOOT_JAR_NAME }}
|
BOOT_JAR_NAME: ${{ inputs.BOOT_JAR_NAME }}
|
||||||
|
IMAGE_TAG_ECR: ${{ inputs.IMAGE_TAG_ECR }}
|
||||||
run: |
|
run: |
|
||||||
docker build --build-arg=IMAGE_TAG=$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
|
docker build --build-arg=IMAGE_TAG=$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
|
||||||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
docker build --build-arg=IMAGE_TAG=$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
|
docker build --build-arg=IMAGE_TAG=$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_ECR .
|
||||||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_ECR
|
||||||
|
|
||||||
- name: Logout on Arbina ECR
|
- name: Logout on Arbina ECR
|
||||||
run: docker logout ${{ secrets.SECRET_ECR_REGISTRY }}
|
run: docker logout ${{ secrets.SECRET_ECR_REGISTRY }}
|
||||||
|
|||||||
Reference in New Issue
Block a user