Merge pull request #5 from HealthSamurai/single-css-file #187
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy demo UI to GitHub Pages | |
on: | |
push: | |
branches: ["main"] | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: "16" | |
- name: Setup Clojure | |
uses: DeLaGuardo/[email protected] | |
with: | |
bb: latest | |
cli: 1.11.1.1155 | |
- name: Cache clojure dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.m2/repository | |
~/.gitlibs | |
~/.deps.clj | |
**/node_modules | |
# List all files containing dependencies: | |
key: cljdeps-${{ hashFiles('deps.edn', 'package-lock.json') }} | |
# key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }} | |
# key: cljdeps-${{ hashFiles('project.clj') }} | |
# key: cljdeps-${{ hashFiles('build.boot') }} | |
restore-keys: cljdeps- | |
- name: Run sync_design_tokens.clj | |
run: bb ./scripts/sync_design_tokens.clj | |
- name: Commit and Push Changes | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
if [ -n "$(git status --porcelain)" ]; then | |
echo "Changes detected. Committing and pushing..." | |
git config user.name "GitHub Action" | |
git config user.email "[email protected]" | |
git add . | |
git commit -m "Update design tokens" | |
git push origin HEAD:main | |
else | |
echo "No changes to commit." | |
fi | |
- name: Setup GH Pages | |
uses: actions/configure-pages@v3 | |
- name: Initialize project | |
run: make init | |
- name: Build with Shadow CLJS | |
run: make pages | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |