actions-gh-pages icon indicating copy to clipboard operation
actions-gh-pages copied to clipboard

support: suggestions on clean up the actions_github_pages_UNIX created folder?

Open acastro2 opened this issue 2 years ago • 2 comments

Checklist

  • [X] I am using the latest version of this action.
  • [X] I have read the latest README and followed the instructions.
  • [X] I have read the latest GitHub Actions official documentation and learned the basic spec and concepts.

Describe your question

I'm using self-hosted workers, and the actions_github_pages folders pile up fast. Any suggestion for cleaning up? Is the folder name output of the action?

Relevant links

name: Update Docs

on:
  workflow_dispatch:
  push:
    branches:
      - 'main'
  schedule:
    - cron: '0 9 * * *'

jobs:
  Update-Docs:
    runs-on: bionic
    steps:
      - uses: actions/checkout@v1
        with:
          submodules: "recursive"
          fetch-depth: 0
      - uses: actions/setup-python@v2
        with:
          python-version: "3.x"
      - run: pip install -r requirements.txt
      - name: Update MkDocs
        run: mkdocs build
      - name: Push to github pages
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./site
  clean-working-directory:
    runs-on: bionic
    needs: Update-Docs
    steps:
      - name: Clean working directory
        run: |
         cd $RUNNER_WORKSPACE
         cd ..
         rm -r *

Relevant log output

No response

Additional context.

No response

acastro2 avatar Jan 31 '22 19:01 acastro2

Thank you for asking this!

We are already aware of this as an issue and this will be resolved in #686 (Or, I will split this issue to another issue)

As a workaround, we can run find ${HOME} -name "actions_github_pages_*" -delete in the clean-working-directory job.

peaceiris avatar Feb 07 '22 09:02 peaceiris

Thank you for asking this!

We are already aware of this as an issue and this will be resolved in #686 (Or, I will split this issue to another issue)

As a workaround, we can run find ${HOME} -name "actions_github_pages_*" -delete in the clean-working-directory job.

Slightly better workaround - find ${HOME} -name "actions_github_pages_*" -exec rm -rf {} + - to also delete non empty directories (at least this was necessary on my RHEL flavored implementation of find).

alaendle avatar May 22 '23 11:05 alaendle