Skip to content

Commit

Permalink
Generate directory listings
Browse files Browse the repository at this point in the history
  • Loading branch information
jacklul committed May 9, 2024
1 parent 66ad0a7 commit 3938577
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 15 deletions.
27 changes: 27 additions & 0 deletions .github/actions/index/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Create directory indexes

inputs:
path:
required: false
default: .

runs:
using: composite

steps:
- name: Pre tasks
shell: bash
run: |
[ -d "${{ inputs.path }}/.git" ] && mv "${{ inputs.path }}/.git" ../.git.bak
find "${{ inputs.path }}" -type f -name "index.html" -exec rm -f "{}" \;
- name: Generate Directory Listings
uses: jayanta525/[email protected]
with:
FOLDER: ${{ inputs.path }}

- name: Post tasks
shell: bash
run: |
find "${{ inputs.path }}" -type f -name "index.html" -exec sudo chown $(id -u):$(id -g) "{}" \;
[ -d "../.git.bak" ] && mv ../.git.bak "${{ inputs.path }}/.git"
26 changes: 11 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,6 @@ jobs:
"GIT_BRANCH=${{ steps.version_infos.outputs.GIT_BRANCH }}"
"GIT_TAG=${{ steps.version_infos.outputs.GIT_TAG }}"
#- name: Upload artifact
# if: steps.cache.outputs.cache-hit != 'true'
# uses: actions/upload-artifact@v4
# with:
# name: build-${{ matrix.arch }}
# path: ./stage/build.tar
# retention-days: 7

- name: Extract FTL binary and generate checksum file
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ./stage
Expand Down Expand Up @@ -368,15 +360,22 @@ jobs:
sudo apt-get update
sudo apt-get install rename
- name: Checkout own repository
uses: actions/checkout@v4
with:
sparse-checkout: .github/*
sparse-checkout-cone-mode: false
path: ../main

- name: Checkout gh-pages branch
uses: actions/checkout@v4
continue-on-error: true
with:
ref: gh-pages

- name: Rename gh-pages branch
run: git branch -m gh-pages gh-pages.old
continue-on-error: true
run: git branch -m gh-pages gh-pages.old

- name: Download artifacts
uses: actions/download-artifact@v4
Expand All @@ -397,15 +396,12 @@ jobs:
run: |
find . -maxdepth 1 -type d -name "*-*" -exec sh -c '[ -d "./artifacts/$(basename {})" ] && rm -frv {}' \;
mv -v ./artifacts/* .
rmdir -v ./artifacts
- name: Create index.html
run: |
rm -f ./index.html
find . -maxdepth 1 -type d -not -name ".git" -not -name "." -exec sh -c 'echo "<a href=\"$(basename {})/Packages.html\">$(basename {})</a><br>" >> index.html' \;
- name: Generate directory listings
uses: ../main/.github/actions/index

- name: List files
run: ls -aAl
uses: ../main/.github/actions/list

- name: Upload packages
uses: JamesIves/github-pages-deploy-action@v4
Expand Down

0 comments on commit 3938577

Please sign in to comment.