-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
68 lines (58 loc) · 1.92 KB
/
Copy pathaction.yml
File metadata and controls
68 lines (58 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: "Tuzuru - Generate and Deploy Blog"
description: "Install tuzuru via npm, generate blog, and deploy to GitHub Pages"
inputs:
config:
description: "Path to tuzuru.json (relative to working-directory)"
required: false
default: ""
runs:
using: "composite"
steps:
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
- name: Install Tuzuru
shell: bash
run: npm install -g @ainame/tuzuru@0.6.1 # x-release-please-version
- name: Generate blog
shell: bash
run: |
set -euo pipefail
if [[ -n "${{ inputs.config }}" ]]; then
tuzuru generate -c "${{ inputs.config }}"
else
tuzuru generate
fi
- name: Get output directory from config
id: config
shell: bash
run: |
set -euo pipefail
CONFIG_FILE="${{ inputs.config }}"
if [[ -z "$CONFIG_FILE" ]]; then
CONFIG_FILE="tuzuru.json"
fi
if [[ -f "$CONFIG_FILE" ]]; then
OUTPUT_DIR=$(jq -r '.output.directory // "blog"' "$CONFIG_FILE")
else
OUTPUT_DIR="blog"
fi
echo "output-dir=$OUTPUT_DIR" >> "$GITHUB_OUTPUT"
- name: Copy public directory contents
shell: bash
run: |
set -euo pipefail
if [[ -d "public" ]]; then
echo "Copying contents from public/ to ${{ steps.config.outputs.output-dir }}/"
echo "Note: Files in public/ take precedence and will overwrite generated files in ${{ steps.config.outputs.output-dir }} when names conflict."
cp -r public/. "${{ steps.config.outputs.output-dir }}/"
else
echo "No public/ directory found, skipping"
fi
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: ${{ steps.config.outputs.output-dir }}
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4