Skip to content

Commit e5295b3

Browse files
authored
Add GHA-based auto-deployment (#3)
* add a github workflow to auto-deploy * bump version * update readme
1 parent 1a92314 commit e5295b3

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches:
5+
- main
6+
permissions:
7+
contents: write
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Setup Node
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '16'
19+
- name: Install Dependencies
20+
run: npm install
21+
- name: Build
22+
run: npm run build
23+
- name: Configure Git
24+
run: |
25+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
26+
git config --global user.name "github-actions[bot]"
27+
- name: Deploy to GitHub Pages
28+
env:
29+
CI: true
30+
GIT_USER: github-actions[bot] # Add user for gh-pages package
31+
GITHUB_TOKEN: ${{ github.token }} # Authenticate with the token
32+
run: npx gh-pages -d build --repo https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git
33+
34+

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ It's all relatively uncomplicated. All you need to do is fork this repository in
1616

1717
You can have as many links as you want and each one can be accompanied by an icon (provided by [FontAwesome](https://fontawesome.com/)). There are two built-in themes based on Ethan Schoonover's popular [Solarized](https://ethanschoonover.com/solarized/) color schemes, but folks who are fancy with CSS can build their own color schemes or themes. (And please do! [Contributions are welcome!](https://github.com/jazzsequence/jazzsequence.github.io/pulls))
1818

19+
## Automated Deployment
20+
21+
See below if you want to use manual deployments and want to opt out of automatic GitHub Pages deployments.
22+
23+
By default, since 1.2.0, your projects will auto-deploy to GitHub pages whenever you push or merge a commit to the `main` branch. No configuration is required. The GitHub Actions bot uses its own token and runs the build and deploy workflows autonomously so you don't have to. 🎉
24+
1925
### Requirements
2026
* [NodeJS](https://nodejs.org/en) (this project is foundationally based on Node 16. Other versions may not work. You might want to use [nvm](https://github.com/nvm-sh/nvm) to manage multiple Node versions)
2127
* Some kind of command-line tool. I like [Warp](https://www.warp.dev/) (for MacOS).
22-
* [FontAwesome v5](https://fontawesome.com/v5/search) - While this isn't a _requirement_ in the sense that you need to install anything, the v5 / v6 syntax is different, so you'll want to make sure you're looking at _v5_ documentation when referencing icon names.
28+
* [FontAwesome v6](https://fontawesome.com/v6/search) - While this isn't a _requirement_ in the sense that you need to install anything, the v5 / v6 syntax is different, so you'll want to make sure you're looking at _v5_ documentation when referencing icon names. The FontAwesome script has been updated to use v6 icons and the syntax is backwards-compatible, meaning `fa-brands` (referenced in v6 documentation/examples) still supports the `fab` prefix.
2329

2430
### Getting started
2531
The repository comes with a `details-example.js` file to get you started. Copy this into a `details.js` file where you will make your changes. You will probably want to commit this file to your repository, otherwise this file will only exist on your local machine and will not exist if you ever move machines, delete the local copy, etc.
@@ -54,7 +60,10 @@ Color schemes are attached to a class that is added to the main `div` that wraps
5460
You can build and test your profile locally by running an `npm install` and then using the `npm run dev` script. That will open a new browser window that live-updates when you make changes to the source code. Use `Command + X`/`Control + X` to stop the script from running when you're done developing.
5561

5662
### Deploying your new profile!
57-
First things first, you'll need to run `npm install` to install the various Node dependencies. Some of these are for local development which, if you don't plan on making changes to the code, you won't be using, but you might if you do decide to make any custom tweaks.
63+
64+
First things first, if you want to manually deploy, you need to remove the `deploy.yml` in `.github/workflows`. The GitHub workflow is designed to be hands-off and just deploys on pushes to `main`.
65+
66+
Assuming you've done that, you'll need to run `npm install` to install the various Node dependencies. Some of these are for local development which, if you don't plan on making changes to the code, you won't be using, but you might if you do decide to make any custom tweaks.
5867

5968
Before you deploy, you'll need to add a line to the `package.json` file. This is simply going to tell GitHub that it should look at your compiled app rather than your readme (which is what it does by default). Find the `"homepage"` line in the `package.json` and in the empty string (`""`), enter in the full URL to where your profile page will live (`https://{yourusername}.github.io`, for example, the full line in my compiled `package.json` file would be: `"homepage": "https://jazzsequence.github.io"`).
6069

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sapling-chain",
3-
"version": "1.1.1",
3+
"version": "1.2.0",
44
"description": "Create a tree of hyperlinks that can be used in social media profiles. 🔗🌲😂",
55
"author": "Chris Reynolds <[email protected]>",
66
"license": "GPL-3.0-or-later",

0 commit comments

Comments
 (0)