diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..3f3234a2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: Pull Request Pipeline + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build-and-test: + name: Build and generate artifact + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 22 + + - name: Install dependencies + run: npm ci + + - name: Build the project + run: npm run build + + - name: Upload build artifact + uses: actions/upload-artifact@v3 + with: + name: site-preview-pr-${{ github.event.pull_request.number }} + path: ./build diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9fb618a8..df1da694 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Deploy Docusaurus to GitHub Pages +name: Deploy to GitHub Pages on: push: diff --git a/README.md b/README.md index 0c6c2c27..25374c87 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,13 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati ### Installation ``` -$ yarn +$ npm i ``` ### Local Development ``` -$ yarn start +$ npm run start ``` This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. @@ -19,23 +19,36 @@ This command starts a local development server and opens up a browser window. Mo ### Build ``` -$ yarn build +$ npm run build ``` This command generates static content into the `build` directory and can be served using any static contents hosting service. -### Deployment +### Reviewing Pull Requests -Using SSH: +This project uses GitHub Actions to automate building, testing, and generating a preview for pull requests. Here's how you can review pull requests effectively: -``` -$ USE_SSH=true yarn deploy -``` +1. **Open the Pull Request**: + - Navigate to the **Pull Requests** tab in the repository. + - Select the PR you want to review. -Not using SSH: +2. **Access the Build Artifact**: + - Go to the **Actions** tab in the repository. + - Find the workflow run associated with the pull request (usually named `Pull Request Pipeline`). + - Scroll down to the **Artifacts** section and download the artifact named `site-preview-pr-` (e.g., `site-preview-pr-123`). -``` -$ GIT_USER= yarn deploy -``` +3. **Preview the Changes**: + - Extract the downloaded artifact. + - Serve the files locally using a simple HTTP server. For example: + ```bash + npx http-server -p 8080 + ``` + - Open `http://localhost:8080` in your browser to review the changes. + +4. **Provide Feedback**: + - Leave comments or suggestions directly in the pull request under the **Files changed** tab. + + +### Deployment -If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. +There is a [pipeline](.github/workflows/deploy.yml) that will deploy anytime that a new commit lands to `main` branch. \ No newline at end of file