From f018554df6a441dd5fb6e77b2a85315844e53607 Mon Sep 17 00:00:00 2001 From: Sean Shriver Date: Wed, 22 Nov 2023 17:34:18 -0600 Subject: [PATCH] preview_build support --- .github/scripts/build-assets.py | 13 +++++++++++++ .github/workflows/main.yml | 9 ++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/scripts/build-assets.py b/.github/scripts/build-assets.py index 10d53fad..72dc5518 100644 --- a/.github/scripts/build-assets.py +++ b/.github/scripts/build-assets.py @@ -1,8 +1,10 @@ import os import sys +import time import glob import shutil import ntpath +import tempfile import subprocess from pathlib import Path from zipfile import ZipFile @@ -69,4 +71,15 @@ workshop_zip.write(python_script, tail) shutil.move(os.path.join(os.getcwd(), zip_file_name), os.path.join(dest_root, 'assets', zip_file_name)) +# Check build +shell_out = tempfile.NamedTemporaryFile(mode='w') +proc = subprocess.Popen(['preview_build'], + stdout=shell_out, stderr=shell_out) +time.sleep(10) +#os.system("ps -e | grep \"preview_build\" | awk") +proc.kill() +with open(shell_out.name) as f: + for line in f: + print(line) +shell_out.close() exit() diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2120ca69..700e1ce6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,22 +24,17 @@ jobs: with: submodules: 'recursive' fetch-depth: '0' - - name: Setup Hugo - uses: peaceiris/actions-hugo@v2 - with: - hugo-version: '0.102.3' - # extended: true - name: Setup Python uses: actions/setup-python@v4 with: python-version: '3.10' - - name: Build Hugo - run: hugo --buildFuture - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: aws-region: us-east-1 role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + - name: Pull preview build + run: aws s3 cp s3://amazon-dynamodb-labs-static/build/preview_build . && chmod +x preview_build - name: Build Assets run: python3 ./.github/scripts/build-assets.py - name: S3Sync