From 8e8d77bc6e99fca9510c02b6c16da3b902a915f2 Mon Sep 17 00:00:00 2001 From: Alessandro Pignotti Date: Fri, 19 May 2023 11:04:40 +0200 Subject: [PATCH] Simplify workflow configuration --- .github/workflows/deploy.yml | 22 +--------------------- README.md | 1 - index.html | 3 +-- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 14be7e3..00abbb6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,12 +19,6 @@ on: required: true default: '600M' - LOGIN_UGID: - type: string - description: 'UID:GID of the starting process' - required: true - default: "1000:1000" - DEPLOY_TO_GITHUB_PAGES: type: boolean description: 'Deploy to Github pages' @@ -37,12 +31,6 @@ on: required: true default: false - GITHUB_RELEASE_TAG: - type: string - description: 'Tag for the GitHub release' - required: true - default: "ext2_image" - jobs: build: @@ -79,11 +67,6 @@ jobs: run: | echo "IMAGE_NAME=$(basename ${{ github.event.inputs.DOCKERFILE_PATH }})_$(date +%Y%m%d)_${{ github.run_id }}.ext2" >> $GITHUB_ENV - # We extract the uid and gid from the uid:gid input. - - run: | - echo "LOGIN_UID=$(echo ${{ github.event.inputs.LOGIN_UGID }} | cut -d ':' -f1)" >> $GITHUB_ENV - echo "LOGIN_GID=$(echo ${{ github.event.inputs.LOGIN_UGID }} | cut -d ':' -f2)" >> $GITHUB_ENV - # Create directory to host the image from. - run: sudo mkdir -p $DEPLOY_DIR @@ -122,13 +105,10 @@ jobs: sudo split ${{ env.IMAGE_NAME }} ${{ env.DEPLOY_DIR }}/${{ env.IMAGE_NAME }}.c -a 6 -b 128k -x --additional-suffix=.txt sudo bash -c "stat -c%s ${{ env.IMAGE_NAME }} > ${{ env.DEPLOY_DIR }}/${{ env.IMAGE_NAME }}.meta" # This step updates the default index.html file by performing the following actions: - # 1. Replaces all occurrences of UID and GID with their respective input parameters. # 2. Replaces all occurrences of IMAGE_URL with the URL to the image. # 3. Replaces all occurrences of DEVICE_TYPE to bytes. - name: Adjust index.html run: | - sudo sed -i 's#UID#"${{ env.LOGIN_UID }}"#g' ${{ env.DEPLOY_DIR }}index.html - sudo sed -i 's#GID#"${{ env.LOGIN_GID }}"#g' ${{ env.DEPLOY_DIR }}index.html sudo sed -i 's#IMAGE_URL#"${{ env.IMAGE_NAME }}"#g' ${{ env.DEPLOY_DIR }}index.html sudo sed -i 's#DEVICE_TYPE#"split"#g' ${{ env.DEPLOY_DIR }}index.html @@ -157,7 +137,7 @@ jobs: uses: softprops/action-gh-release@v0.1.15 with: target_commitish: ${{ github.sha }} # Last commit on the GITHUB_REF branch or tag - tag_name: ${{ github.event.inputs.GITHUB_RELEASE_TAG }} # Tag of the release. + tag_name: ext2_image fail_on_unmatched_files: 'true' # Fail in case of no matches with the file(s) glob(s). files: | # Assets to upload as release. ${{ env.IMAGE_NAME }} diff --git a/README.md b/README.md index 3ac9793..bbeaf1c 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,6 @@ From a local `git clone` - You can also build your own by selecting the "Upload GitHub release" workflow option. - Place the image in the repository root folder. - Edit `index.html` - - Replace the `UID`/`GID` variables with `1000` - Replace `DEVICE_TYPE` with `"bytes"` - Replace `IMAGE_URL` with the name of the Ext2 image. For example `"debian_mini_20230519_5022088024.ext2"` - Start a local HTTP server diff --git a/index.html b/index.html index cfed55d..d31a8f5 100644 --- a/index.html +++ b/index.html @@ -286,8 +286,7 @@ __ __ _ __ ____ __ consoleDiv.addEventListener("dragleave", preventDefaults, false); consoleDiv.addEventListener("drop", preventDefaults, false); - // The variables uid and gid are replaced by Github Actions. - var opts = {env:structure.env, cwd:"/home/user", uid: UID, gid: GID}; + var opts = {env:structure.env, cwd:"/home/user", uid: 1000, gid: 1000}; while (true) { await cxLogAndRun(cx, structure.cmd, structure.args, opts);