Skip to content

Commit

Permalink
V2: Use Docusaurus (#92)
Browse files Browse the repository at this point in the history
BREAKING CHANGES: Use Docusaurus
  • Loading branch information
Pradumnasaraf authored Jul 24, 2024
1 parent e3b13b8 commit 73c7d3e
Show file tree
Hide file tree
Showing 280 changed files with 17,087 additions and 271 deletions.
35 changes: 27 additions & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
.git*
*.md
!README.md
.nojekyll
.dockerignore
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/.next
**/.cache
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/charts
**/docker-compose*
**/compose.y*ml
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
**/build
**/dist
LICENSE
Dockerfile
releases.json
docker-compose.yml
README.md
20 changes: 9 additions & 11 deletions .github/workflows/publish-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,26 @@ on:
workflow_dispatch:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v4

- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1

- name: DockerHub Login
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Read YAML file for version
uses: pietrobolcato/action-read-yaml@1.0.0
id: read_yaml
with:
config: ${{ github.workspace }}/version.yaml

- name: Build the Docker image
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKERHUB_USERNAME }}/devops:${{ steps.read_yaml.outputs['version'] }}
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKERHUB_USERNAME }}/devops:${{ steps.package-version.outputs.current-version}}

- name: Docker Push
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/devops:${{ steps.read_yaml.outputs['version'] }}
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/devops:${{ steps.package-version.outputs.current-version}}
20 changes: 8 additions & 12 deletions .github/workflows/publish-ghcr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Package - GHCR
name: Publish Image - GHCR

on:
release:
Expand All @@ -17,7 +17,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1

- name: Log in to the Container registry
uses: docker/login-action@v2
Expand All @@ -32,18 +36,10 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Read YAML file for version
uses: pietrobolcato/action-read-yaml@1.0.0
id: read_yaml
with:
config: ${{ github.workspace }}/version.yaml

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
ghcr.io/pradumnasaraf/devops:latest
ghcr.io/pradumnasaraf/devops:${{ steps.read_yaml.outputs['version'] }}
labels: ${{ steps.meta.outputs.labels }}
tags: ghcr.io/pradumnasaraf/devops:${{ steps.package-version.outputs.current-version}}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 2 additions & 2 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.PA_TOKEN }}
version-file: './version.yaml'
version-file: 'package.json, package-lock.json'

- name: create release
if: steps.changelog.outputs.skipped == 'false'
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/vercel-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Vercel Preview Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches-ignore:
- main
jobs:
Deploy-Preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/vercel-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Vercel Production Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches:
- main
jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
# 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*

.env
.DS_Store
.vercel
9 changes: 5 additions & 4 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
tasks:
- name: Start web server
init: python -m http.server 8000
- name: Install dependencies
init: npm install
command: npm start
ports:
- port: 8000
onOpen: open-browser
- port: 3000
onOpen: open-preview

github:
prebuilds:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#### Code

- [HTML](https://www.w3schools.com/html/)
- [Node.js](https://nodejs.org/en/)

## 💥 How to Contribute

Expand Down
1 change: 0 additions & 1 deletion Docker/Prod-app-demo/.gitignore

This file was deleted.

Empty file.
15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
FROM nginx:1.23.2
WORKDIR /usr/share/nginx/html
ARG NODE_VERSION=20
FROM node:${NODE_VERSION}

WORKDIR /usr/src/app

COPY package*.json ./
RUN npm ci

COPY . .
EXPOSE 80

EXPOSE 3000

CMD ["npm", "start", "--", "--host", "0.0.0.0"]
Loading

0 comments on commit 73c7d3e

Please sign in to comment.