The deploy.yml workflow automatically builds and deploys the Armchair application to GitHub Pages.
-
Trigger: The workflow runs automatically on every push to the
mainbranch, or can be triggered manually via the Actions tab. -
Build Process:
- Sets up Node.js (using the version specified in
.node-version) - Sets up Java 17 (required for shadow-cljs/ClojureScript compilation)
- Installs npm dependencies
- Creates a
.envfile with the necessary environment variables - Runs the build process (similar to
scripts/build.sh) which:- Compiles ClojureScript using shadow-cljs
- Compiles Sass stylesheets
- Compiles Tailwind CSS
- Versions the output files using the git commit hash
- Updates
index.htmlto reference the versioned files
- Sets up Node.js (using the version specified in
-
Deploy: Uploads the
buildfolder contents to GitHub Pages
To enable GitHub Pages deployment for this repository:
- Go to your repository Settings → Pages
- Under "Build and deployment", select "GitHub Actions" as the source
- The workflow will automatically deploy on the next push to
main
You can manually trigger a deployment:
- Go to the Actions tab in your GitHub repository
- Select "Deploy to GitHub Pages" workflow
- Click "Run workflow"
- Select the branch and click "Run workflow"
The workflow inline builds the project instead of calling scripts/build.sh directly because:
sed -i ""(macOS syntax) doesn't work on Linux - the workflow usessed -i(Linux syntax)- Better visibility of each build step in the Actions logs
- More control over error handling and logging
The build logic is functionally identical to scripts/build.sh.