-
Notifications
You must be signed in to change notification settings - Fork 385
169 lines (139 loc) · 4.89 KB
/
ibis.yml
File metadata and controls
169 lines (139 loc) · 4.89 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
167
168
169
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 }}
deploy-pages:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: gd, zip, mbstring
coverage: none
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-dev --optimize-autoloader
- name: Generate HTML for Pages
run: composer run html
- name: Create Pages directory
run: |
mkdir -p _site
cp ebook/en/export/101-linux-commands.html _site/index.html
cp ebook/en/export/101-linux-commands.html index.html
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: _site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4