From 272a1de130ce5a20de6be0151ee9dacae1a6b39a Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 21 Sep 2021 15:42:40 +0100 Subject: [PATCH] CI updates for self host --- .github/workflows/release.yml | 18 ++++++++++++++++++ package.json | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8dd1d55f87..bc797b7492 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,12 @@ on: push: branches: - master + workflow_dispatch: + inputs: + release_self_host: + description: 'Release to self hosters? (Y/N)' + required: true + default: 'N' env: POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }} @@ -47,6 +53,18 @@ jobs: uses: "WyriHaximus/github-action-get-previous-tag@v1" - name: Build/release Docker images + if: ${{ github.event.inputs.release_self_host == 'N' }} + run: | + docker login -u $DOCKER_USER -p $DOCKER_PASSWORD + yarn build + yarn build:docker + env: + DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }} + BUDIBASE_RELEASE_VERSION: ${{ steps.previoustag.outputs.tag }} + + - name: Build/release Docker images (Self Host) + if: ${{ github.event.inputs.release_self_host == 'Y' }} run: | docker login -u $DOCKER_USER -p $DOCKER_PASSWORD yarn build diff --git a/package.json b/package.json index 05c69e54dc..7e329faafa 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,8 @@ "lint:fix": "yarn run lint:fix:ts && yarn run lint:fix:prettier && yarn run lint:fix:eslint", "test:e2e": "lerna run cy:test", "test:e2e:ci": "lerna run cy:ci", - "build:docker": "lerna run build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh $BUDIBASE_RELEASE_VERSION release && cd -", + "build:docker": "lerna run build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh $BUDIBASE_RELEASE_VERSION && cd -", + "build:docker:production": "lerna run build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh $BUDIBASE_RELEASE_VERSION release && cd -", "build:docker:develop": "node scripts/pinVersions && lerna run build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh develop && cd -", "release:helm": "./scripts/release_helm_chart.sh", "multi:enable": "lerna run multi:enable",