-
Notifications
You must be signed in to change notification settings - Fork 385
166 lines (145 loc) · 5.82 KB
/
ibis.yml
File metadata and controls
166 lines (145 loc) · 5.82 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: eBook Build, Deploy & Release
on:
push:
branches:
- main
paths-ignore:
- 'cli/**'
- '.github/workflows/cli.yml'
pull_request:
branches:
- main
paths-ignore:
- 'cli/**'
- '.github/workflows/cli.yml'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
outputs:
files-changed: ${{ steps.verify-changed-files.outputs.changed }}
new-tag: ${{ steps.tag.outputs.new_tag }}
tag-created: ${{ steps.tag.outputs.tag }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: gd, zip, mbstring
coverage: none
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress --optimize-autoloader
- name: Generate eBooks (All Formats)
run: |
composer run pdf
composer run pdf-dark
composer run epub
composer run html
composer run sample
composer run sample-dark
- name: Check for changes
id: verify-changed-files
run: |
# Check if there are changes in eBook-related files specifically
# This will be true only if there are actual eBook changes (regardless of cli changes)
if git diff --quiet HEAD -- ebook/ index.html composer.json composer.lock; then
echo "changed=false" >> $GITHUB_OUTPUT
echo "No eBook-related changes detected"
else
echo "changed=true" >> $GITHUB_OUTPUT
echo "eBook-related changes detected"
fi
- name: Commit and push changes (GitHub Pages)
if: steps.verify-changed-files.outputs.changed == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git config --local user.email "bobby@bobbyiliev.com"
git config --local user.name "Bobby Iliev"
# Only add eBook-related files, explicitly excluding cli directory
git add ebook/en/export/ index.html
git commit -m "🤖 Auto-update eBook files and GitHub Pages [skip ci]" || exit 0
git push
- name: Create version tag (on main with changes)
id: tag
if: steps.verify-changed-files.outputs.changed == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: anothrNick/github-tag-action@1.75.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: false
DEFAULT_BUMP: minor
- name: Upload eBook artifacts
uses: actions/upload-artifact@v4
with:
name: ebooks-${{ github.sha }}
path: |
ebook/en/export/*.pdf
ebook/en/export/*.epub
ebook/en/export/*.html
index.html
retention-days: 90
release:
needs: build
if: needs.build.outputs.files-changed == 'true' && needs.build.outputs.tag-created != '' && github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
ref: main
- name: Get current date
id: get_date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.build.outputs.new-tag }}
name: "📚 Linux 101 v${{ needs.build.outputs.new-tag }}"
body: |
## 📚 101 Linux Commands - Release v${{ needs.build.outputs.new-tag }}
**Released:** ${{ steps.get_date.outputs.date }} | **Formats:** PDF, EPUB, HTML | **Size:** 6 formats
### 📥 Download Options
| Format | Best For | File |
|--------|----------|------|
| 📄 **PDF Light** | Printing & Desktop | `101-linux-commands-light.pdf` |
| 🌙 **PDF Dark** | Night Reading | `101-linux-commands-dark.pdf` |
| 📱 **EPUB** | E-readers & Mobile | `101-linux-commands.epub` |
| 🌐 **HTML** | Interactive Web | `101-linux-commands.html` |
| 📑 **Sample Light** | Quick Preview | `101-linux-commands-sample-light.pdf` |
| 📑 **Sample Dark** | Preview (Dark) | `101-linux-commands-sample-dark.pdf` |
### ✨ What's New
- **101 Essential Commands** with practical examples
- **Interactive HTML** with dark mode & progress tracking
- **Mobile-optimized** formats for all devices
- **Professional layouts** for each format
### 🚀 Perfect For
Linux beginners • Developers • System admins • Students • Certification prep
### 🔗 Quick Links
- 🌐 [**Read Online**](https://devdojo.github.io/101-linux-commands/)
- 🐛 [Report Issues](../../issues/new?template=bug_report.md)
- 💡 [Suggestions](../../issues/new?template=feature_request.md)
- 📝 [Contribute](../../blob/main/CONTRIBUTING.md)
---
**Auto-generated** from commit `${{ github.sha }}` • Built on ${{ steps.get_date.outputs.date }}
files: |
ebook/en/export/101-linux-commands-light.pdf
ebook/en/export/101-linux-commands-dark.pdf
ebook/en/export/101-linux-commands.epub
ebook/en/export/101-linux-commands.html
ebook/en/export/101-linux-commands-sample-light.pdf
ebook/en/export/101-linux-commands-sample-dark.pdf
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}