From b892cfab9bd152c47a709e8708491c95b8c3ec8e Mon Sep 17 00:00:00 2001 From: John Andersen Date: Sat, 12 Mar 2022 13:43:20 -0800 Subject: [PATCH] ci: remove images: Remove after success Signed-off-by: John Andersen --- .github/workflows/remove_images.yml | 71 ----------------------------- 1 file changed, 71 deletions(-) delete mode 100644 .github/workflows/remove_images.yml diff --git a/.github/workflows/remove_images.yml b/.github/workflows/remove_images.yml deleted file mode 100644 index ed3ad26cbe..0000000000 --- a/.github/workflows/remove_images.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Remove Images - -on: - push: - paths: - - '.github/workflows/remove_images.yml' - -jobs: - remove_images: - runs-on: ubuntu-latest - - steps: - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: Install git-filter-repo - shell: bash -xe {0} - run: | - pip install -U pip setuptools wheel - pip install git-filter-repo - - name: Run git-filter-repo - env: - REPO_URL: https://github.com/intel/dffml - BRANCH: gh-pages - GIT_FILTER_REPO_PATHS: /tmp/git-filter-repo-paths - SSH_DFFML_GH_PAGES: ${{ secrets.SSH_DFFML_GH_PAGES }} - shell: bash -xe {0} - run: | - git init - git remote add origin $REPO_URL - git fetch origin $BRANCH - git reset --hard origin/$BRANCH - git log -n 3 --oneline - git log --stat | grep -E '\.png|\.jpeg|\.jpg|\.gif' - cat > $GIT_FILTER_REPO_PATHS <<'EOF' - glob:*.gif - glob:*.png - glob:*.jpg - glob:*.jpeg - EOF - git filter-repo --force --invert-paths --paths-from-file $GIT_FILTER_REPO_PATHS - set +e - git log --stat | grep -E '\.png|\.jpeg|\.jpg|\.gif' - set -e - - export GIT_SSH_COMMAND='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' - - TEMP_DIRS=() - - function cleanup_temp_dirs() { - for temp_dir in ${TEMP_DIRS[@]}; do - rm -rf "${temp_dir}" - done - } - - # Clean up temporary directories on exit - trap cleanup_temp_dirs EXIT - - ssh_key_dir="$(mktemp -d)" - TEMP_DIRS+=("${ssh_key_dir}") - python -c "import pathlib, base64, os; keyfile = pathlib.Path(\"${ssh_key_dir}/github\").absolute(); keyfile.write_bytes(b''); keyfile.chmod(0o600); keyfile.write_bytes(base64.b32decode(os.environ['SSH_DFFML_GH_PAGES']))" - ssh-keygen -y -f "${ssh_key_dir}/github" > "${ssh_key_dir}/github.pub" - export GIT_SSH_COMMAND="${GIT_SSH_COMMAND} -o IdentityFile=${ssh_key_dir}/github" - - set +e - git remote add origin git@github.com:intel/dffml - git remote set-url origin git@github.com:intel/dffml - set -e - - git push -fu origin $BRANCH