Skip to content

Commit

Permalink
Have GH Actions regen content, now that docker hub is paywalled for d…
Browse files Browse the repository at this point in the history
…evs.
  • Loading branch information
oubiwann committed Dec 24, 2023
1 parent 17c79e7 commit 0663df5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
34 changes: 26 additions & 8 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,39 @@ concurrency:
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Build job
build:
runs-on: ubuntu-latest
env:
ZOLA_VERSION: 0.17.2
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
- uses: taiki-e/install-action@v2
with:
tool: zola@${ZOLA_VERSION}
- name: Install TailwindCSS
run:
npm install
npm install yarn
yarn add tailwindcss@latest @tailwindcss/typography preline@latest
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build content and regen CSS
run: make cicd-build
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: "./site"
path: ./site

# Deployment job
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
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ zola-build: clean

build: zola-build docker-build tailwind-build

cicd-zola-build:
@echo " >> Building site ..."
@zola build -o $(PUBLISH_DIR)

cicd-build: cicd-zola-build cicd-tailwind-build

serve: tailwind-build docker-build
@echo " >> Running site ..."
@docker run \
Expand Down Expand Up @@ -134,3 +140,8 @@ tailwind-build:
$(DOCKER_FQN) \
tailwindcss -i $(TAILWIND_INPUT) -o $(TAILWIND_OUTPUT) --minify
cp $(TAILWIND_BASE)/*.js $(JS_OUTPUT)

cicd-tailwind-build:
@echo " >> Regenerated CSS ..."
@npx tailwindcss -i $(TAILWIND_INPUT) -o $(TAILWIND_OUTPUT) --minify
@cp $(TAILWIND_BASE)/*.js $(JS_OUTPUT)

0 comments on commit 0663df5

Please sign in to comment.