Build/Push Docker Image #88
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#******************************************************************************* | |
# doHCFILES.yml | |
# | |
# Interlisp workflow to run HCFILES. HCFILES prints out PDF files for all of the | |
# files in the Medley directory and posts them on files.interlisp.org. | |
# | |
# This workflow is designed to be kickjed off by the buildReleaseInclDocker | |
# workflow running in the Medley repo, once the release has been completed successfully | |
# | |
# Copyright 2024 by Interlisp.org | |
# | |
# ****************************************************************************** | |
name: Run HCFILES | |
# Run this workflow on ... | |
on: | |
workflow_dispatch: | |
inputs: | |
draft: | |
description: "Mark this as a draft release" | |
type: choice | |
options: | |
- 'false' | |
- 'true' | |
force: | |
description: "Force build even if build already successfully completed for this commit" | |
type: choice | |
options: | |
- 'false' | |
- 'true' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
run_HCFILES: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Medley repo | |
uses: actions/checkout@v4 | |
- name: Checkout notecards | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.repository_owner }}/notecards | |
path: ./notecards | |
- name: Checkout loops | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.repository_owner }}/loops | |
path: ./loops | |
- name: Checkout test | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.repository_owner }}/test | |
path: ./test | |
- name: Cleanup .git for notecards, loops, test | |
run: rm -rf ./notecards/.git ./loops/.git ./test/.git | |
- name: Download Maiko | |
run: | | |
gh release download --output /tmp/maiko.tgz \ | |
--repo ${{ github.repository_owner }}/maiko \ | |
--pattern '*-linux.x86_64.tgz' | |
tar -xzf /tmp/maiko.tgz | |
env: | |
GH_TOKEN: ${{ secrets.MU_TOKEN }} | |
- name: Install vnc & ghostscript (ps2pdf) | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y tightvncserver | |
sudo apt-get install -y ghostscript | |
which ps2pdf | |
- name: Build apps.sysout | |
run: | | |
Xvnc -geometry 1280x720 :0 & | |
export DISPLAY=":0" | |
scripts/loadup-all.sh -apps | |
- name: Run HCFILES | |
run: | | |
export DISPLAY=":0" | |
scripts/do_hcfiles.sh | |
- name: Push Medley files (including created pdf files) to files.interlisp.org | |
run: | | |
# create a tar file of all of the directories to be pushed | |
tarfile=/tmp/source-$$.tgz | |
tar -c -z -f ${tarfile} --exclude=.git . | |
# set up ssh identity | |
eval $(ssh-agent) | |
ssh-add - <<< "${SSH_KEY}" | |
# set destination directory on files.interlisp.org | |
dest=/srv/oio/files/source | |
# Push tar file up to files.interlisp.org | |
batchfile=/tmp/batch-$$ | |
echo "-put ${tarfile} ${dest}.tgz" > ${batchfile} | |
sftp -o StrictHostKeyChecking=no -b ${batchfile} [email protected] | |
# now tar is up, untar it and juggle backups | |
scriptfile=/tmp/script-$$ | |
echo "rm -rf ${dest}.new" > ${scriptfile} | |
echo "mkdir -p ${dest}.new" >> ${scriptfile} | |
echo "tar -C ${dest}.new -x -z -f ${dest}.tgz" >> ${scriptfile} | |
echo "rm -f ${dest}.tgz" >> ${scriptfile} | |
echo "rm -rf ${dest}.oldold" >> ${scriptfile} | |
echo "if [ -e ${dest}.old ]; then mv ${dest}.old ${dest}.oldold; fi" >> ${scriptfile} | |
echo "if [ -e ${dest} ]; then mv ${dest} ${dest}.old; fi" >> ${scriptfile} | |
echo "mv ${dest}.new ${dest}" >> ${scriptfile} | |
ssh -aTxo BatchMode=yes [email protected] /bin/sh -s < ${scriptfile} | |
env: | |
SSH_KEY: ${{ secrets.OIO_SSH_KEY }} | |