refactor: move static assets + rework syntax themes #9
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: Build and Deploy to Cloudflare Pages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Homebrew | |
id: set-up-homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- uses: tecolicom/actions-use-homebrew-tools@v1 | |
with: | |
tools: cestef/tap/zola svgo | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install | |
- name: Cache Zola build | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.cache | |
public | |
key: ${{ runner.os }}-zola-${{ hashFiles('**/*.md', 'config.toml', 'templates/**/*') }} | |
restore-keys: | | |
${{ runner.os }}-zola- | |
- name: Build Tailwind CSS | |
run: pnpm run css:build | |
- name: Build Zola site | |
run: zola build | |
- name: Display structure of built files | |
run: ls -R public | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: site | |
path: public | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: site | |
path: public | |
- name: Display structure of downloaded files | |
run: ls -R public | |
- name: Deploy | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
command: pages deploy public --project-name=blog-cstef-dev | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} |