Skip to content

v1.0.0-alpha.0 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Deploy to Development Environment

# /client app - deploy to Firebase Hosting

on:
push:
branches:
- dev

jobs:
lint-client:
name: Lint and Export client
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_BASE_PATH: ""
RELEASE_VERSION: ${{ secrets.RELEASE_VERSION }}
RELEASE_PAGE: ${{ secrets.RELEASE_PAGE }}
COMMIT_ID: ${{ secrets.COMMIT_ID }}
OPENGRAPH_IMAGE_URL: ${{ secrets.OPENGRAPH_IMAGE_URL }}
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Use NodeJS v20.15.0
uses: actions/setup-node@v3
with:
node-version: 20.15.0
- name: Install Dependencies
run: |
cd docs
npm install
- name: Lint
run: |
cd docs
npm run lint
- name: Export static files
run: |
cd docs
npm run export
touch out/.nojekyll
- name: Archive Development Artifact
uses: actions/upload-artifact@v3
with:
name: dev-out
path: |
docs/out
docs/.firebaserc
docs/firebase.json
retention-days: 3

deploy-client:
name: Deploy Client to Firebase Hosting
needs: lint-client
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: dev-out
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting:dev
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
63 changes: 63 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Deploy to GitHub Pages

# This workflow will trigger on any tag/release created on *any* branch
# Make sure to create tags/releases only from the "master" branch for consistency
on:
release:
types: [published]

jobs:
lint-export-client:
name: Lint and Export client
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_BASE_PATH: ${{ secrets.NEXT_PUBLIC_BASE_PATH }}
RELEASE_VERSION: ${{ secrets.RELEASE_VERSION }}
RELEASE_PAGE: ${{ secrets.RELEASE_PAGE }}
COMMIT_ID: ${{ secrets.COMMIT_ID }}
OPENGRAPH_IMAGE_URL: ${{ secrets.OPENGRAPH_IMAGE_URL }}
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Use NodeJS v20.15.0
uses: actions/setup-node@v3
with:
node-version: 20.15.0
- name: Install Dependencies and lint
run: |
cd docs
npm install
- name: Lint
run: |
cd docs
npm run lint
- name: Export static files
run: |
cd docs
npm run export
- name: Disable Jekyll
run: touch docs/out/.nojekyll
- name: Archive Development Artifact
uses: actions/upload-artifact@v3
with:
name: main-out
path: docs/out
retention-days: 3

deploy-client:
name: Deploy client to Github Pages
needs: lint-export-client
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: main-out
- name: List files for publish
run: ls -l -a
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./
publish_branch: gh-pages
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint Files

on:
push:
branches-ignore:
- main
- dev

jobs:
lint-client:
name: Lint Client
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Use NodeJS v20.15.0
uses: actions/setup-node@v3
with:
node-version: 20.15.0
- name: Install Dependencies
run: |
cd docs
npm install
- name: Lint
run: |
cd docs
npm run lint
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,56 @@

ACAP Bicol (ACAP 2.0) Development Documentation

### Requirements

The following dependencies are used for this project. Feel free to experiment using other dependencies and versions.

1. Windows 10 64-bit OS
2. nvm version 1.1.12 (for Windows)
3. NodeJS LTS v20.15.0
- _(installed using **nvm**)_
- node v20.15.0
- npm 10.7.0

### Core Libraries and Frameworks

The app depends these libraries and frameworks.

- NextJS v14.2.5
- Nextra v2.13.4
- nextra-theme-docs v2.13.4
- React v18.3.1
- TailwindCSS v3.4.7

## Installation

1. Clone this repository.<br>
`git clone https://github.com/acaptutorials/acaptutorials.github.io.git`

2. Install dependencies.<br>
```
cd docs
npm install
```
3. Set up the environment variables. Create a `.env` file inside the **/docs** directory with reference to the `.env.example` file.

| Variable Name | Description |
| --- | --- |
| RELEASE_VERSION | Latest respository Release (Tag) number |
| RELEASE_PAGE | Latest GitHub release page |
| COMMIT_ID | Default branch's commit sha related to the `RELEASE_VERSION` |
| OPENGRAPH_IMAGE_URL | URL of a 1200x630 image to be used as an OpenGraph thumbnail |
| BASE_URL | The base URL for the frontend of the documentation website. |

## Usage

1. Run the app for local dedvelopment with:<br>
```
cd docs
npm run dev
```
2. Add or edit MDX files in the `/pages` directory, or add React components in the `/components` directory.
- View the [**nextra**](https://nextra.site/docs) (docs-theme) documentation for more information on using nextra to add content.

@acaptutorials<br>
20240806
5 changes: 5 additions & 0 deletions docs/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
RELEASE_VERSION=0.0.0-alpha.0
RELEASE_PAGE=https://github.com/<GITHUB_REPOSITORY_ORG_OR_ACCOUNT>/<GITHUB_REPOSITORY>/releases/tag/0.0.0-alpha.0
COMMIT_ID=123456
OPENGRAPH_IMAGE_URL=https://<DOMAIN_URL>/banner.png
BASE_URL=https://localhost:3000
30 changes: 30 additions & 0 deletions docs/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"env": {
"node": true,
"browser": true,
"commonjs": true,
"es6": true
},
"extends": [
"next/core-web-vitals",
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
],
"plugins": [
"eslint-plugin-react", "eslint-plugin-react-hooks"
],
"rules": {
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "never"],
"no-unused-vars": "error",
"no-undef": "error",
"no-trailing-spaces": "error",
"jsx-quotes": ["error", "prefer-double"],
"react/react-in-jsx-scope": "off",
"no-console": ["error", { "allow": ["error"] }],
"import/no-anonymous-default-export": "off"
}
}
16 changes: 16 additions & 0 deletions docs/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"projects": {
"default": "acaptutorials-dev"
},
"targets": {
"acaptutorials-dev": {
"hosting": {
"dev": [
"acaptutorials"
]
}
}
},
"etags": {},
"dataconnectEmulatorConfig": {}
}
6 changes: 6 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
out/
.next/
.firebase
*.zip
.env
11 changes: 11 additions & 0 deletions docs/components/BannerText.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function BannerText () {
const version = process.env.RELEASE_VERSION ?? '0.0.0'

return (
<a href={process.env.RELEASE_PAGE ?? '#'} target="_blank" rel="noreferrer">
🎉 {version}, dev branch @{process.env.COMMIT_ID ?? '123456'} is released. Read more →
</a>
)
}

export default BannerText
6 changes: 6 additions & 0 deletions docs/components/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## /components

Put React components here

@ciatph<br>
20240806
11 changes: 11 additions & 0 deletions docs/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"hosting": [{
"target": "dev",
"public": "out",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}]
}
8 changes: 8 additions & 0 deletions docs/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
}
}
23 changes: 23 additions & 0 deletions docs/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const withNextra = require('nextra')({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.jsx'
})

module.exports = withNextra({
reactStrictMode: true,
trailingSlash: true,
output: 'export',
images: {
// Use unoptimized for static hosting
unoptimized: true
},
env: {
RELEASE_PAGE: process.env.RELEASE_PAGE,
RELEASE_VERSION: process.env.RELEASE_VERSION,
COMMIT_ID: process.env.COMMIT_ID,
OPENGRAPH_IMAGE_URL: process.env.OPENGRAPH_IMAGE_URL
}
})

// If you have other Next.js configurations, you can pass them as the parameter:
// module.exports = withNextra({ /* other next.js config */ })
Loading
Loading