-
Notifications
You must be signed in to change notification settings - Fork 384
134 lines (111 loc) · 4.1 KB
/
ibis.yml
File metadata and controls
134 lines (111 loc) · 4.1 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
name: Ibis Next eBook Generation and Deploy
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
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: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
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 --no-dev --optimize-autoloader
- name: Generate PDF (Light Theme)
run: composer run pdf
- name: Generate PDF (Dark Theme)
run: composer run pdf-dark
- name: Generate EPUB
run: composer run epub
- name: Generate HTML
run: composer run html
- name: Generate Sample PDF (Light Theme)
run: composer run sample && composer run sample-dark
- name: Check for changes
id: verify-changed-files
run: |
if git diff --quiet HEAD -- ebook/en/export/; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
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"
git add ebook/en/export/
git commit -m "🤖 Auto-update eBook files [skip ci]" || exit 0
git push
- 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
retention-days: 90
- name: Create Release (on main push with changes)
if: steps.verify-changed-files.outputs.changed == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ github.run_number }}
name: eBook Release v${{ github.run_number }}
body: |
## 📚 101 Linux Commands eBook - Release v${{ github.run_number }}
This release contains the latest version of the eBook in multiple formats:
- **PDF (Light Theme)**: Ideal for printing and desktop reading
- **PDF (Dark Theme)**: Perfect for dark mode readers
- **EPUB**: Compatible with e-readers, tablets, and mobile devices
- **HTML**: Single-page web version for online reading
### 📥 Downloads
Choose your preferred format from the assets below.
### 🔄 Changes
This release was automatically generated from commit ${{ github.sha }}.
### 🙏 Contributing
Want to help improve this eBook? Check out our [contributing guidelines](CONTRIBUTING.md).
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
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit and push HTML for Pages
if: steps.verify-changed-files.outputs.changed == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git add index.html
git commit -m "🌐 Auto-update GitHub Pages HTML [skip ci]" || exit 0
git push