Skip to content

Commit

Permalink
Merge pull request #1262 from yashksaini-coder/static-site
Browse files Browse the repository at this point in the history
🌐 Feature: Website setup completed
  • Loading branch information
pankaj-bind authored Oct 27, 2024
2 parents ce546a0 + b0287df commit 8ab15fc
Show file tree
Hide file tree
Showing 40 changed files with 20,577 additions and 18 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/add-contributor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Update Contributors in README

on:
push:
branches: ["master"]
workflow_dispatch:

jobs:
contrib-readme-job:
runs-on: ubuntu-latest
name: A job to automate contrib in readme
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Update Contributors List
uses: akhilmhdh/[email protected]
with:
commit_message: "Updated contributors list"
committer_username: "yashksaini"
committer_email: "[email protected]"
readme_path: "static-site/src/pages/Contributors.md"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main
- static-site
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
workflow_dispatch:

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm

- name: Install dependencies
run: cd static-site && npm install
- name: Build website
run: cd static-site && npm run build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: static-site/build

deploy:
name: Deploy to GitHub Pages
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
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 }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
26 changes: 26 additions & 0 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test deployment

on:
pull_request:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

jobs:
test-deploy:
name: Test deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm

- name: Install dependencies
run: cd static-site && npm install
- name: Test build website
run: cd static-site && npm run build
5 changes: 0 additions & 5 deletions Website/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions Website/index.html

This file was deleted.

1 change: 0 additions & 1 deletion Website/script.js

This file was deleted.

1 change: 0 additions & 1 deletion Website/styles.css

This file was deleted.

6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions static-site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions static-site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions static-site/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
11 changes: 11 additions & 0 deletions static-site/blog/2024-10-26-first-blog-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
slug: Setup
title: Setup Docusaurus
authors: [yashksaini-coder]
tags: [create, docusaurus]
---

This is my first blog post. It is a simple blog post. I contributed to this project, by the AlgoGenesis. where I made the site more beautiful and user friendly using the docusaurus.

<!-- truncate -->

9 changes: 9 additions & 0 deletions static-site/blog/authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
yashksaini-coder:
name: Yash Kumar Saini
title: Open Source Contributor
url: https://github.com/yashksaini-coder
image_url: https://avatars.githubusercontent.com/u/115717039?s=400&u=d86f6a86d63432afcd2df20f13677bd9486688d8&v=4
page: true
socials:
x: EasycodesDev
github: yashksaini-coder
19 changes: 19 additions & 0 deletions static-site/blog/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
facebook:
label: Facebook
permalink: /facebook
description: Facebook tag description

hello:
label: Hello
permalink: /hello
description: Hello tag description

docusaurus:
label: Docusaurus
permalink: /docusaurus
description: Docusaurus tag description

create:
label: Create
permalink: /create
description: create tag description
Loading

0 comments on commit 8ab15fc

Please sign in to comment.