Skip to content

Commit

Permalink
preview_build support
Browse files Browse the repository at this point in the history
  • Loading branch information
switch180 committed Nov 22, 2023
1 parent ff2e423 commit f018554
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
13 changes: 13 additions & 0 deletions .github/scripts/build-assets.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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()
9 changes: 2 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f018554

Please sign in to comment.