ACAP Bicol (ACAP 2.0) development documentation.
Built with Nextra, a modern static site generation framework running on NextJS.
This project uses Nextra version 2.
The following dependencies are used for this project. Feel free to experiment using other dependencies and versions.
- Windows 10 64-bit OS
- nvm version 1.1.12 (for Windows)
- NodeJS LTS v20.15.0
- (installed using nvm)
- node v20.15.0
- npm 10.7.0
The app depends these libraries and frameworks.
- NextJS v14.2.5
- Nextra v2.13.4 [v2]
- nextra-theme-docs v2.13.4
- React v18.3.1
- TailwindCSS v3.4.7
- Requirements
- Installation
- Usage
- Available Scripts
- Usage with Docker
- Usage with GitHub Actions
- Deployment to Docker Hub
-
Clone this repository.
git clone https://github.com/acaptutorials/acaptutorials.github.io.git
-
Install dependencies.
cd docs npm install
-
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. WATCHPACK_POLLING Enables hot reload on NextJS apps running inside Docker containers on a Windows host. Set it to true if running Docker Desktop with WSL2 on a Windows OS.
-
Run the app for local dedvelopment with:
cd docs npm run dev
-
(Optional) Run the app for local development using Docker. Navigate to the project's root directory then run:
# 2.1. Build the client and server containers for localhost development. docker compose -f docker-compose.dev.yml build # 2.2. Create and start the development client and server containers docker compose -f docker-compose.dev.yml up # 2.3. Stop and remove the development containers, networks, images and volumes docker compose -f docker-compose.dev.yml down
-
Add or edit MDX files in the
/pages
directory, or add React components in the/components
directory.- View the nextra (docs-theme) documentation for more information on using nextra to add content.
Starts the local NextJS / Nextra app in development mode on localhost.
Builds the static site into the "out"
directory.
Checks lint errors.
Fixes lint errors.
Usage with Docker is an alternate option to using Node directly from the Usage section.
https://hub.docker.com/r/acaptutorials/acaptutorials.github.io
-
Pull the development Docker image from Docker Hub using one of the options.
docker pull acaptutorials/acaptutorials.github.io:latest
docker compose -f docker-compose.dev.yml pull
(using Docker compose from the root project directory)
-
Navigate to the project directory using the command line. Create a
.env
file inside the /docs directory with reference to the.env.example
file.- See Usage - step # 2 for more information.
-
Run the development Docker image.
docker compose -f docker-compose.dev.yml up
-
(Optional) Run the development Docker image (from other directories).
docker run -it --rm -p 3000:3000 acaptutorials/acaptutorials.github.io:latest
-
Build the development Docker image on your machine.
docker compose -f docker-compose.dev.yml build
-
Navigate to the project directory using the command line. Create a
.env
file inside the /docs directory with reference to the.env.example
file.- See Usage - step # 2 for more information.
-
Run the development Docker image.
docker compose -f docker-compose.dev.yml up
- Add the environment variables described in the Installation - step # 2 section to GitHub Secrets.
- Create a Release to deploy the site to the production environment (GitHub Pages).
- To update the banner content while there are no code or content updates:
- Update the GitHub Secrets:
RELEASE_VERSION
,COMMIT_ID
andRELEASE_PAGE
- Re-deploy the latest production environment workflow from the GitHub Actions tab.
- Update the GitHub Secrets:
This repository deploys the latest development Docker image acaptutorials/acaptutorials.github.io:latest
to Docker Hub on the creation of new Tags/Releases with GitHub Actions. Supply the following GitHub Secrets and Variable to enable deployment to Docker Hub. It requires a Docker Hub account.
The Docker Hub image is available at:
https://hub.docker.com/r/acaptutorials/acaptutorials.github.io
GitHub Secret | Description |
---|---|
DOCKERHUB_USERNAME | Docker Hub username |
DOCKERHUB_TOKEN | Deploy token for the Docker Hub account |
GitHub Variable | Description |
---|---|
DOCKERHUB_USERNAME | Docker Hub username |
@acaptutorials
20240806
20250601