diff --git a/.github/workflows/pr_preview.yml b/.github/workflows/pr_preview.yml index 5cc6ee649..22ba72e54 100644 --- a/.github/workflows/pr_preview.yml +++ b/.github/workflows/pr_preview.yml @@ -42,17 +42,38 @@ jobs: if: ${{ github.event.action == 'closed' }} runs-on: ubuntu-latest steps: - - name: Checkout uses: actions/checkout@v3 - - - name: Python setup - uses: actions/setup-python@v4 with: - python-version: 3.x + ref: gh-pages + + - name: Remove pr-preview + shell: bash + run: | + folder=pr-preview/pr-${{ github.event.number }} + if [ -z $folder ] + then + echo "Nothing to remove!" + exit 0 + fi + rm -rf $folder + + - name: Commit to gh-pages + shell: bash + run: | + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor }}@users.noreply.github.com" + git add . + git commit -m "Remove 'pr-preview/pr-${{ github.event.number }}' folder." + git push origin gh-pages + + # - name: Python setup + # uses: actions/setup-python@v4 + # with: + # python-version: 3.x - - name: Clean preview - uses: access-nri/pr-preview-action@v2.1.1 - with: - action: remove - pr-number: ${{ github.event.number }} \ No newline at end of file + # - name: Clean preview + # uses: access-nri/pr-preview-action@v2.1.1 + # with: + # action: remove + # pr-number: ${{ github.event.number }} \ No newline at end of file