Skip to content

Commit 19ee734

Browse files
authored
update README for docs on latest usage
1 parent be58b89 commit 19ee734

1 file changed

Lines changed: 54 additions & 11 deletions

File tree

README.md

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
# Github Pages Directory Listing
2+
[![main](https://github.com/jayanta525/github-pages-directory-listing/actions/workflows/main.yml/badge.svg)](https://github.com/jayanta525/github-pages-directory-listing/actions/workflows/main.yml)
23
[![license](https://img.shields.io/github/license/jayanta525/github-pages-directory-listing)](https://github.com/jayanta525/github-pages-directory-listing/blob/main/LICENSE)
34
[![Paypal Donate](https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=plastic)](https://www.paypal.me/jayanta525)
45

6+
57
Generate Directory Listings for Github Pages using Github Actions.
68

79
[Demo](https://github.com/jayanta525/github-pages-directory-listing#demo)
10+
11+
[action.yml/workflow.yml](https://github.com/jayanta525/github-pages-directory-listing/blob/main/.github/workflows/main.yml)
812
## Usage
913
### Getting Started
1014

11-
Add a `.github/workflows/workflow.yml` to the root of your project where you want directory listings to be enabled.
15+
Add a `.github/workflows/workflow.yml` to the root of your repository.
1216
```
1317
name: directory-listing
1418
on: [push]
1519
1620
jobs:
17-
pages-directory-listing-release:
21+
pages-directory-listing:
1822
runs-on: ubuntu-latest
1923
name: Directory Listings Index
2024
steps:
@@ -24,16 +28,32 @@ jobs:
2428
ref: dummy-data #checkout different branch
2529
2630
- name: Generate Directory Listings
27-
uses: jayanta525/github-pages-directory-listing@v2.0.0
31+
uses: jayanta525/github-pages-directory-listing@v3.0.0
2832
with:
29-
FOLDER: data #directory to generate index
33+
FOLDER: data #directory to generate index
3034
31-
- name: Deploy to Pages
32-
uses: JamesIves/github-pages-deploy-action@4.1.3
35+
- name: Upload artifact
36+
uses: actions/upload-pages-artifact@v1
3337
with:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35-
BRANCH: gh-pages
36-
FOLDER: data
38+
path: 'data' # upload generated folder
39+
40+
deploy:
41+
needs: pages-directory-listing
42+
permissions:
43+
pages: write # to deploy to Pages
44+
id-token: write # to verify the deployment originates from an appropriate source
45+
46+
# Deploy to the github-pages environment
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
51+
# Specify runner + deployment step
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v1
3757
```
3858

3959
### Options
@@ -44,15 +64,38 @@ jobs:
4464
with:
4565
ref: dummy-data #checkout different branch
4666
```
67+
#### Checkout different repository
68+
```
69+
- name: Checkout tools repo
70+
uses: actions/checkout@v3
71+
with:
72+
repository: my-org/my-tools #repo public url
73+
path: my-tools #folder to clone to
74+
ref: branch-name #branch to clone
75+
```
4776
#### Choosing a folder to generate indexing
4877
```
4978
- name: Generate Directory Listings
5079
uses: jayanta525/github-pages-directory-listing@v2.0.0
5180
with:
5281
FOLDER: data #directory to generate index
5382
```
83+
#### Refer here for more options: https://github.com/marketplace/actions/checkout
84+
85+
## Note
86+
87+
This action uses Github's own pages deploy action. So, no gh-pages branch is required.
5488

5589
## Demo
56-
demo URL: https://jayanta525.github.io/openwrt-r4s-kmods/
90+
demo URL: https://jayanta525.github.io/github-pages-directory-listing/
91+
92+
93+
### Desktop view
94+
95+
![image](https://user-images.githubusercontent.com/30702133/226169193-66c27c81-fdc7-499d-88e4-1a1c8571ecce.png)
96+
97+
### Mobile View
98+
99+
![image](https://user-images.githubusercontent.com/30702133/226169252-b74d3a40-7928-4804-bd66-8292a6259531.png)
100+
57101

58-
![image](https://user-images.githubusercontent.com/30702133/184577947-7ebc8b2e-3998-47c7-9289-4069f281f13a.png)

0 commit comments

Comments
 (0)