Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

CI/CD config updates

Rich Turner7855db41f8ff
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 465c8504a..29e21193f 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -151,6 +151,11 @@ jobs:
secrets = json.loads(os.getenv('secret'))
for key, value in secrets.items():
+ if key.startswith("_"):
+ if not key.startswith("_" + os.getenv('environment') + "_"):
+ continue
+ else:
+ key = key.lstrip("_" + os.getenv('environment') + "_")
print(f"Setting {key} ...")
lines = len(value.split("\n"))
if lines > 1:
@@ -161,6 +166,7 @@ jobs:
os.system(f"echo '{key}={value}' >> $GITHUB_ENV")
env:
secret: ${{ toJSON(secrets) }}
+ environment: ${{ github.event.inputs.environment }}
- name: Determine host name
id: host-name
@@ -333,13 +339,13 @@ jobs:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
-
+
- name: Grant execute permission for gradlew and make image-cache
if: ${{ env.MANAGER_BUILD == 'true' || env.DEPLOYMENT_BUILD == 'true' }}
run: |
chmod +x gradlew
mkdir -p ~/image-cache
-
+
- name: Get yarn cache directory path
if: ${{ env.MANAGER_BUILD == 'true' || env.DEPLOYMENT_BUILD == 'true' }}
id: yarn-cache-dir-path
@@ -354,7 +360,7 @@ jobs:
key: ${{ runner.os }}-yarn---${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn---
-
+
- name: Do code build
if: ${{ env.MANAGER_BUILD == 'true' || env.DEPLOYMENT_BUILD == 'true' }}
run: |
@@ -379,13 +385,13 @@ jobs:
- name: Build and save manager image
if: ${{ env.MANAGER_BUILD == 'true' }}
run: |
- docker build --build-arg GIT_COMMIT=$MANAGER_VERSION --platform $PLATFORM -t openremote/manager:$MANAGER_VERSION $MANAGER_PATH
+ docker build --load --build-arg GIT_COMMIT=$MANAGER_VERSION --platform $PLATFORM -t openremote/manager:$MANAGER_VERSION $MANAGER_PATH
docker save openremote/manager:$MANAGER_VERSION | gzip > temp/manager.tar.gz
- name: Build and save deployment image
if: ${{ env.DEPLOYMENT_BUILD == 'true' }}
run: |
- docker build --build-arg GIT_COMMIT=$DEPLOYMENT_VERSION --platform $PLATFORM -t openremote/deployment:$DEPLOYMENT_VERSION $DEPLOYMENT_PATH
+ docker build --load --build-arg GIT_COMMIT=$DEPLOYMENT_VERSION --platform $PLATFORM -t openremote/deployment:$DEPLOYMENT_VERSION $DEPLOYMENT_PATH
docker save openremote/deployment:$DEPLOYMENT_VERSION | gzip > temp/deployment.tar.gz
- name: Copy files to host
@@ -452,7 +458,7 @@ jobs:
# Start the stack
docker-compose -f temp/docker-compose.yml -p or up -d
-
+
- name: Wait for up to 5 mins for manager webserver to be running
run: |
echo "Waiting for manager web server https://$HOST..."