Skip to content

Commit

Permalink
Merge pull request #2 from HarshitaShroff/main
Browse files Browse the repository at this point in the history
Setup of Astro website (starlight) with CI/CD workflow and deployment on Netlify
  • Loading branch information
aNebula authored May 13, 2024
2 parents 32ed10a + 0acb1ad commit 9621805
Show file tree
Hide file tree
Showing 33 changed files with 9,796 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Description

_Please include a summary of the change and which issue is fixed. Please also include relevant
motivation and context. List any dependencies that are required for this change._

Fixes # (issue)

## Type of change

_Please delete options that are not relevant._

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as
expected)
- [ ] Documentation (update or new)

## How Has This Been Tested?

_Please describe the tests that you ran to verify your changes. Provide instructions so we can
reproduce. Please also list any relevant details for your test configuration_

## Testing Checklist

- [ ] Tested in latest Chrome
- [ ] Tested in latest Safari
- [ ] Tested in latest Firefox

## Checklist

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have requested a review from ... on the Pull Request
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
pull_request:
push:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Linelint
uses: fernandrone/linelint@master
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 16.14.2
- name: Install dependencies
run: npm install
- name: Prettier
run: npm run format:check
- name: Vale
run: |
sudo apt update
sudo apt install snapd
sudo snap install vale --edge
npm run prose:check
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
18 changes: 18 additions & 0 deletions .linelint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 'true' will fix files
autofix: true

# list of paths to ignore, uses gitignore syntaxes (executes before any rule)
ignore:
- .git/

rules:
# checks if file ends in a newline character
end-of-file:
# set to true to enable this rule
enable: true

# set to true to disable autofix (if enabled globally)
disable-autofix: false

# if true also checks if file ends in a single newline character
single-new-line: true
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.vscode
node_modules
package.json
package-lock.json
yarn.lock
dist


13 changes: 13 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @type {import('prettier').Config} */
module.exports = {
printWidth: 120,
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
useTabs: false,

plugins: ['prettier-plugin-astro'],

overrides: [{ files: '*.astro', options: { parser: 'astro' } }],
};
12 changes: 12 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Vale configuration file.
#
# For more information, see https://errata-ai.gitbook.io/vale/getting-started/configuration.

StylesPath = .vale
MinAlertLevel = suggestion

[*.md]


# Ignore SVG markup
TokenIgnores = (\*\*\{\w*\}\*\*)
58 changes: 58 additions & 0 deletions .vale/vale-json.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{{- /* Modify Vale's output https://docs.errata.ai/vale/cli#--output */ -}}

{{- /* Keep track of our various counts */ -}}

{{- $e := 0 -}}
{{- $w := 0 -}}
{{- $s := 0 -}}
{{- $f := 0 -}}

{{- /* Range over the linted files */ -}}

{{- range .Files}}

{{- $f = add1 $f -}}
{{- $path := .Path -}}

{{- /* Range over the file's alerts */ -}}
[

{{- range $idx, $a := .Alerts -}}

{{- $error := "" -}}
{{- if eq .Severity "error" -}}
{{- $error = .Severity -}}
{{- $e = add1 $e -}}
{{- else if eq .Severity "warning" -}}
{{- $error = .Severity -}}
{{- $w = add1 $w -}}
{{- else -}}
{{- $error = .Severity -}}
{{- $s = add1 $s -}}
{{- end}}

{{- /* Variables setup */ -}}

{{- $path = $path -}}
{{- $loc := printf "%d" .Line -}}
{{- $check := printf "%s" .Check -}}
{{- $message := printf "%s" .Message -}}
{{- $link := printf "%s" .Link -}}
{{- if $idx -}},{{- end -}}

{{- /* Output */ -}}

{
"description": "{{ $message }}",
"fingerprint": "{{ $path }}-{{ $loc }}",
"severity": "{{ $error }}",
"location": {
"path": "{{ $path }}",
"lines": {
"begin": {{ $loc }}
}
}
}
{{end -}}
{{end -}}
]
51 changes: 51 additions & 0 deletions .vale/vale-tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{{- /* Modify Vale's output https://docs.errata.ai/vale/cli#--output */ -}}

{{- /* Keep track of our various counts */ -}}

{{- $e := 0 -}}
{{- $w := 0 -}}
{{- $s := 0 -}}
{{- $f := 0 -}}

{{- /* Range over the linted files */ -}}

{{- range .Files}}

{{- $f = add1 $f -}}
{{- $path := .Path | underline -}}

{{- /* Range over the file's alerts */ -}}

{{- range .Alerts -}}

{{- $error := "" -}}
{{- if eq .Severity "error" -}}
{{- $error = .Severity | red -}}
{{- $e = add1 $e -}}
{{- else if eq .Severity "warning" -}}
{{- $error = .Severity | yellow -}}
{{- $w = add1 $w -}}
{{- else -}}
{{- $error = .Severity | blue -}}
{{- $s = add1 $s -}}
{{- end}}

{{- /* Variables setup */ -}}

{{- $path = $path -}}
{{- $loc := printf "Line %d, position %d" .Line (index .Span 0) -}}
{{- $check := printf "%s" .Check -}}
{{- $message := printf "%s" .Message -}}
{{- $link := printf "%s" .Link -}}

{{- /* Output */ -}}

{{ $path }}:
{{ $loc }} (rule {{ $check }})
{{ $error }}: {{ $message }}
More information: {{ $link }}

{{end -}}
{{end -}}

{{- $e}} {{"errors" | red}}, {{$w}} {{"warnings" | yellow}}, and {{$s}} {{"suggestions" | blue}} found.
4 changes: 4 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
},
{
"name": "Docker Node.js Launch",
"type": "docker",
"request": "launch",
"preLaunchTask": "docker-run: debug",
"platform": "node"
}
]
}
39 changes: 39 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "docker-build",
"label": "docker-build",
"platform": "node",
"dockerBuild": {
"dockerfile": "${workspaceFolder}/Dockerfile",
"context": "${workspaceFolder}",
"pull": true
}
},
{
"type": "docker-run",
"label": "docker-run: release",
"dependsOn": [
"docker-build"
],
"platform": "node"
},
{
"type": "docker-run",
"label": "docker-run: debug",
"dependsOn": [
"docker-build"
],
"dockerRun": {
"env": {
"DEBUG": "*",
"NODE_ENV": "development"
}
},
"node": {
"enableDebugging": true
}
}
]
}
Loading

0 comments on commit 9621805

Please sign in to comment.