mirror of
https://github.com/softinio/softinio.com.git
synced 2025-09-05 11:16:41 -07:00
fix: correct generate_feeds config and add caching to GitHub Actions
- Fix typo in config.toml: generate_feed -> generate_feeds - Add Nix store caching to speed up CI builds - Add flake inputs caching for faster dependency resolution
This commit is contained in:
parent
a4f3aeee9f
commit
1fd2958cdf
2 changed files with 24 additions and 8 deletions
30
.github/workflows/deploy.yml
vendored
30
.github/workflows/deploy.yml
vendored
|
@ -9,18 +9,34 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@v31
|
uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
extra_nix_config: |
|
extra_nix_config: |
|
||||||
experimental-features = nix-command flakes
|
experimental-features = nix-command flakes
|
||||||
|
|
||||||
|
- name: Setup Nix store cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: /nix/store
|
||||||
|
key: ${{ runner.os }}-nix-store-${{ hashFiles('**/flake.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-nix-store-
|
||||||
|
|
||||||
|
- name: Cache flake inputs
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.cache/nix
|
||||||
|
key: ${{ runner.os }}-nix-flake-${{ hashFiles('**/flake.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-nix-flake-
|
||||||
|
|
||||||
- name: Build site (pull request)
|
- name: Build site (pull request)
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
|
@ -29,7 +45,7 @@ jobs:
|
||||||
nix build
|
nix build
|
||||||
nix flake show
|
nix flake show
|
||||||
ls result
|
ls result
|
||||||
|
|
||||||
- name: Deploy to Cloudflare Pages (pull request)
|
- name: Deploy to Cloudflare Pages (pull request)
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
|
@ -37,16 +53,16 @@ jobs:
|
||||||
env:
|
env:
|
||||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
|
|
||||||
- name: Build site (main branch)
|
- name: Build site (main branch)
|
||||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||||
run: |
|
run: |
|
||||||
nix build
|
nix build
|
||||||
|
|
||||||
- name: Deploy to Cloudflare Pages (main branch)
|
- name: Deploy to Cloudflare Pages (main branch)
|
||||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||||
run: |
|
run: |
|
||||||
nix develop --command wrangler pages deploy result --project-name=softinio --commit-dirty=true
|
nix develop --command wrangler pages deploy result --project-name=softinio --commit-dirty=true
|
||||||
env:
|
env:
|
||||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
|
|
|
@ -3,7 +3,7 @@ theme = "tabi"
|
||||||
title = "Salar Rahmanian"
|
title = "Salar Rahmanian"
|
||||||
description = "Software Engineer based in San Francisco Bay Area"
|
description = "Software Engineer based in San Francisco Bay Area"
|
||||||
author = "Salar Rahmanian"
|
author = "Salar Rahmanian"
|
||||||
generate_feed = true
|
generate_feeds = true
|
||||||
compile_sass = true
|
compile_sass = true
|
||||||
minify_html = true
|
minify_html = true
|
||||||
build_search_index = true
|
build_search_index = true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue