Directory listing for Github Pages
Go to file
Jayantajit Gogoi c5ac9e8501
Some checks failed
main / Run Actions Template (push) Has been cancelled
main / deploy (push) Has been cancelled
updated README
2025-02-20 23:20:29 +05:30
.devcontainer devcontainer: update config files to use new base image 2023-04-03 13:14:48 +05:30
.github test updated actions 2025-02-20 23:16:28 +05:30
docs docs: add documentations 2022-08-05 18:46:16 +00:00
src Add absolute paths 2024-10-22 23:59:49 +05:30
.gitignore main: fix arguments check in main 2023-03-19 15:11:47 +05:30
action.yml license: add MIT license 2022-08-05 18:46:16 +00:00
Dockerfile src: update python3 interpreter 2023-04-03 13:17:45 +05:30
entrypoint.sh src: update python3 interpreter 2023-04-03 13:17:45 +05:30
LICENSE Update LICENSE 2023-03-19 11:11:22 +05:30
README.md updated README 2025-02-20 23:20:29 +05:30

Github Pages Directory Listing

main license Paypal Donate

Generate Directory Listings for Github Pages using Github Actions.

Demo

Read about pages deployment action

action.yml/workflow.yml

Usage

Getting Started

Add a .github/workflows/workflow.yml to the root of your repository.

name: directory-listing
on: [push]

jobs:
  pages-directory-listing:
    runs-on: ubuntu-latest
    name: Directory Listings Index
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4
        with:
          ref: dummy-data    #checkout different branch

      - name: Generate Directory Listings
        uses: jayanta525/github-pages-directory-listing@v4.0.0
        with:
          FOLDER: data      #directory to generate index

      - name: Upload artifact
        uses: actions/upload-pages-artifact@v3.0.1
        with:
          path: 'data'      # upload generated folder
  
  deploy:
    needs: pages-directory-listing
    permissions:
      pages: write      # to deploy to Pages
      id-token: write   # to verify the deployment originates from an appropriate source

    # Deploy to the github-pages environment
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}

    # Specify runner + deployment step
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4.0.0

Options

Checkout different branch

      - name: Checkout Repository
        uses: actions/checkout@v4
        with:
          ref: dummy-data    #checkout different branch

Checkout different repository

      - name: Checkout tools repo
        uses: actions/checkout@v4
        with:
          repository: my-org/my-tools     #repo public url
          path: my-tools                  #folder to clone to
          ref: branch-name               #branch to clone

Choosing a folder to generate indexing

      - name: Generate Directory Listings
        uses: jayanta525/github-pages-directory-listing@v4.0.0
        with:
          FOLDER: data    #directory to generate index

Refer here for more options: https://github.com/marketplace/actions/checkout

Note

This action uses Github's own pages deploy action. No gh-pages branch is required. Under Settings > Pages > Build & Deployment

image

Demo

demo URL: https://jayanta525.github.io/github-pages-directory-listing/

Desktop view

image

Mobile View

image