Skip to content

Commit 66024bb

Browse files
Merged Website to Astro!
Merge pull request #2 from shravanngoswamii/astro-merge
2 parents 21cde29 + 4a106e3 commit 66024bb

File tree

183 files changed

+14911
-29162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+14911
-29162
lines changed

.firebaserc

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/firebase-hosting-merge.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/firebase-hosting-pull-request.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/preview.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: PR Preview Workflow
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, synchronize, closed]
6+
7+
jobs:
8+
build-and-preview:
9+
if: github.event.action == 'opened' || github.event.action == 'synchronize'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
ref: ${{ github.event.pull_request.head.sha }}
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm install
25+
26+
- name: Build the website
27+
run: npm run build
28+
29+
- name: Deploy to GitHub Pages
30+
uses: JamesIves/github-pages-deploy-action@v4
31+
with:
32+
branch: gh-pages
33+
folder: ./dist
34+
target-folder: pr-previews/${{ github.event.pull_request.number }}
35+
clean: false
36+
commit-message: Deploy preview for PR ${{ github.event.pull_request.number }}
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+
39+
comment-preview-url:
40+
needs: build-and-preview
41+
if: needs.build-and-preview.result == 'success'
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Comment Preview URL
45+
uses: thollander/actions-comment-pull-request@v2
46+
with:
47+
message: |
48+
<!-- preview-url-comment -->
49+
Preview the changes: https://shravanngoswamii.github.io/portfolio/pr-previews/${{ github.event.pull_request.number }}
50+
Please avoid using the search feature and navigation bar in PR previews!
51+
comment_tag: preview-url-comment
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
55+
delete-preview-directory:
56+
if: github.event.action == 'closed' || github.event.pull_request.merged == true
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Checkout gh-pages branch
60+
uses: actions/checkout@v4
61+
with:
62+
ref: gh-pages
63+
64+
- name: Remove PR Preview Directory
65+
run: |
66+
PR_NUMBER=${{ github.event.pull_request.number }}
67+
PREVIEW_DIR="pr-previews/${PR_NUMBER}"
68+
git config --global user.name "github-actions[bot]"
69+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
70+
git pull origin gh-pages
71+
rm -rf ${PREVIEW_DIR}
72+
git add .
73+
git commit -m "Remove preview for merged PR #${PR_NUMBER}"
74+
git push
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy Website
2+
3+
on:
4+
push:
5+
branches:
6+
- astro-merge
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 20
16+
cache: 'npm'
17+
18+
- name: Install dependencies
19+
run: npm install
20+
21+
- name: Build the website
22+
run: npm run build
23+
24+
- name: Print current time
25+
run: date
26+
27+
# Will use this after this branch becomes main
28+
# - name: Deploy to gh-pages branch
29+
# uses: JamesIves/github-pages-deploy-action@v4
30+
# with:
31+
# branch: gh-pages
32+
# folder: ./dist
33+
# clean: false
34+
35+
- name: Deploy to GitHub Pages
36+
uses: peaceiris/actions-gh-pages@v3
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: dist
40+
publish_branch: gh-pages
41+
cname: blog.shravangoswami.com
42+
43+
permissions:
44+
contents: write

.gitignore

Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,32 @@
1-
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,firebase
2-
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,firebase
3-
4-
### Firebase ###
5-
.idea
6-
**/node_modules/*
7-
# **/.firebaserc
8-
# firestore.json
9-
10-
### Firebase Patch ###
11-
.runtimeconfig.json
12-
.firebase/
13-
# Ignore GitHub workflow files
14-
# .github/workflows/*
15-
# .github
16-
17-
# scripts/contact.js
18-
19-
### VisualStudioCode ###
20-
.vscode/*
21-
!.vscode/settings.json
22-
!.vscode/tasks.json
23-
!.vscode/launch.json
24-
!.vscode/extensions.json
25-
!.vscode/*.code-snippets
26-
27-
# Local History for Visual Studio Code
28-
.history/
29-
30-
# Built Visual Studio Code Extensions
31-
*.vsix
32-
33-
### VisualStudioCode Patch ###
34-
# Ignore all local history of files
35-
.history
36-
.ionide
37-
.env
38-
39-
build/
40-
node_modules/
41-
.docusaurus/
42-
43-
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,firebase
1+
# build output
2+
dist/
3+
.output/
4+
5+
# dependencies
6+
node_modules/
7+
8+
# logs
9+
npm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
pnpm-debug.log*
13+
14+
15+
# environment variables
16+
.env
17+
.env.production
18+
19+
# macOS-specific files
20+
.DS_Store
21+
22+
# ignore .astro directory
23+
.astro
24+
25+
# yarn
26+
.yarn/*
27+
!.yarn/patches
28+
!.yarn/plugins
29+
!.yarn/releases
30+
!.yarn/sdks
31+
!.yarn/versions
32+
.pnp.*

.vscode/astro-paper.code-snippets

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"Frontmatter": {
3+
"scope": "markdown",
4+
"prefix": "frontmatter",
5+
"body": [
6+
"---",
7+
"author: $1",
8+
"pubDatetime: $CURRENT_YEAR-$CURRENT_MONTH-${CURRENT_DATE}T$CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND.000$CURRENT_TIMEZONE_OFFSET",
9+
"modDatetime: $3",
10+
"title: $4",
11+
"featured: ${5|false,true|}",
12+
"draft: ${6|true,false|}",
13+
"tags:",
14+
" - $7",
15+
"description: $8",
16+
"---",
17+
],
18+
"description": "Adds the frontmatter block for the AstroPaper Blog post"
19+
},
20+
"Blog Template": {
21+
"scope": "markdown",
22+
"prefix": "template",
23+
"body": [
24+
"${1:frontmatter}",
25+
"",
26+
"${2: Introductory Sentence}",
27+
"",
28+
"## Table of contents",
29+
"",
30+
"## ${3: heading 1}",
31+
],
32+
"description": "Adds the template for the AstroPaper Blog post. You will need to trigger the snippet modal on the 'frontmatter' line to insert the other snipper."
33+
}
34+
}

.vscode/extensions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode"],
3+
"unwantedRecommendations": []
4+
}

.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"command": "./node_modules/.bin/astro dev",
6+
"name": "Development server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
}
10+
]
11+
}

0 commit comments

Comments
 (0)