From 6aa20eaf3e7b8e82fa6f21ca63abc31ca3a7d77a Mon Sep 17 00:00:00 2001 From: John Goodliff Date: Mon, 17 Jun 2024 20:11:32 -0600 Subject: [PATCH 1/3] Update deploy script to run once a week --- .github/workflows/deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ec63e1e..637e845 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,6 +5,8 @@ on: workflow_dispatch: push: branches: [$default-branch] + schedule: + - cron: '8 8 * * 6' # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: From 52eb66f8f8cc2314f5d8cb82dddd1fdbffdd1f3d Mon Sep 17 00:00:00 2001 From: John Goodliff Date: Mon, 17 Jun 2024 20:14:18 -0600 Subject: [PATCH 2/3] Add more information to README --- README.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 08da88c..0fa7581 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

- johng.io + johng.io

@@ -26,11 +26,19 @@ +## About +This portfolio site is designed to showcase my work and provide a way to contact me. + +It uses [React] on top of the [Gatsby] framework for static site generation. At build time, it fetches repository data from the [GitHub API] to display a selection of my public repositories. + +The UI is styled with [Tailwind CSS] and [daisyUI]. [TypeScript] is used for type checking, and [Biome.js] is used for linting and formatting. [gatsby-plugin-component-to-image] is used to dynamically generate social images from React components. + + ## Installation ### Prerequisites - -- Node.js and NPM (see [nodejs.org](https://nodejs.org/) for more details) -- Yarn 4 (see the [Yarn docs](https://yarnpkg.com/getting-started/install) for more details) +- [Node.js] +- [Yarn 4] +- A [GitHub personal access token] (PAT) that can be used to access the GitHub API. This token should have public (read-only) access to all repositories as it is used to fetch repository data for the projects section. ### Setup 1. Clone the repo with `https://github.com/jerboa88/jerboa88.github.io.git`. Alternatively, you can download the repository as a zip file and extract it. @@ -39,16 +47,39 @@ ## Usage -We can build the site using the Gatsby CLI, which should have been installed with the install command above. All of the necessary commands are declared in `package.json` for convenience. +### Configuration +#### Required +The `GH_TOKEN` environment variable must be set to your GitHub PAT in order to fetch repository data, otherwise the build will fail. An easy way to do this is to create an `.env.development` or `.env.production` file in the project root like so: + +```sh +# .env.development +GH_TOKEN=your_github_pat_here +``` + +The site is configured to fetch repository data from the `jerboa88` GitHub account by default, so if you want to fetch data for a different user, you will need to replace all instances of `jerboa88` in the code with your own username. -There are two ways to build & serve the site: -1. Use `yarn develop` to run the app in development mode. This will start the development server at [localhost:8000](https://localhost:8000) (by default). The project will automatically be rebuilt when changes are made. +#### Optional +Most of the site's configuration options are set in [src/common/constants.tsx] and [src/config/*.tsx]. -2. Use `yarn build` to generate a production build of the app, then use `yarn serve` to serve it. The site can be viewed at [localhost:9000](https://localhost:9000) (by default). +### Building +We can build the site with the Gatsby CLI. All of the necessary commands are declared in `package.json` for convenience. + +#### Development +Use `yarn develop` to run the app in development mode. This will start the development server at [localhost:8000] (by default). The project will automatically be rebuilt when changes are made. + +#### Production +Use `yarn build` to generate a production build of the app, then use `yarn serve` to serve it. The site can be viewed at [localhost:9000] (by default). + + +### Other `yarn clean` can be used to clear the local Gatsby cache if you encounter any issues with stale data/dependencies. -See the [Gatsby CLI docs](https://www.gatsbyjs.com/docs/reference/gatsby-cli/) for additional commands and options. You will likely have to prefix commands with `yarn` to make sure package resolution works properly. For example, the above `yarn develop` is actually just a shortcut for `yarn gatsby develop`. +`yarn typecheck` can be used to perform type checking using TypeScript. + +`yarn lint` and `yarn format` can be used to apply linting and formatting fixes to the codebase using Biome.js. + +See the [Gatsby CLI docs] for additional commands and options. To run an arbitrary command, prefix it with `yarn` (ex. `yarn gatsby repl`). ## Contributing @@ -59,4 +90,24 @@ x.1 releases mark the final update for a given design, while x.0 releases are re ## License -This project is licensed under the MIT License. See [LICENSE](LICENSE) for details. This project includes various resources which carry their own copyright notices and license terms. See [LICENSE-THIRD-PARTY.md](LICENSE-THIRD-PARTY.md) for more details. +This project is licensed under the MIT License. See [LICENSE] for details. This project includes various resources which carry their own copyright notices and license terms. See [LICENSE-THIRD-PARTY.md] for more details. + + +[Biome.js]: https://biomejs.dev/ +[daisyUI]: https://daisyui.com/ +[Gatsby CLI docs]: https://www.gatsbyjs.com/docs/reference/gatsby-cli/ +[gatsby-plugin-component-to-image]: https://github.com/jerboa88/gatsby-plugin-component-to-image +[Gatsby]: https://www.gatsbyjs.com/ +[GitHub API]: https://docs.github.com/en/graphql +[GitHub personal access token]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens +[LICENSE-THIRD-PARTY.md]: LICENSE-THIRD-PARTY.md +[LICENSE]: LICENSE +[localhost:8000]: https://localhost:8000 +[localhost:9000]: https://localhost:9000 +[Node.js]: https://nodejs.org/ +[React]: https://react.dev/ +[src/common/constants.tsx]: /src/common/constants.tsx +[src/config/*.tsx]: /src/config/*.tsx +[Tailwind CSS]: https://tailwindcss.com/ +[TypeScript]: https://www.typescriptlang.org/ +[Yarn 4]: https://yarnpkg.com/ From c856e1755f5f9b9d719e595bd68811f39669b3ce Mon Sep 17 00:00:00 2001 From: John Goodliff Date: Mon, 17 Jun 2024 21:17:09 -0600 Subject: [PATCH 3/3] Remove CodeQL Analysis workflow --- .github/workflows/codeql-analysis.yml | 50 --------------------------- 1 file changed, 50 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index ae8c891..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: CodeQL Analysis -on: - push: - branches: [ v3 ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ v3 ] - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'typescript', 'javascript' ] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2