-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 560874c
Showing
591 changed files
with
243 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: The World in Brief | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '30 */3 * * *' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
sudo apt-get install -y xdg-utils wget xz-utils python3 | ||
sudo apt-get install -y libxcb-cursor0 libxcb-xinerama0 libegl1 libopengl0 | ||
|
||
- name: Install Calibre | ||
run: | | ||
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin | ||
|
||
- name: Fetch PDF | ||
run: | | ||
wget https://raw.githubusercontent.com/kovidgoyal/calibre/master/recipes/economist_espresso.recipe -O WB.recipe | ||
ebook-convert WB.recipe output.epub | ||
ebook-convert output.epub output.pdf \ | ||
--pdf-page-margin-top 30 \ | ||
--pdf-page-margin-bottom 40 \ | ||
--base-font-size 13 \ | ||
--extra-css "styles.css" | ||
sudo apt-get install -y pdftk | ||
pdftk output.pdf cat 4-end output output_clean.pdf | ||
|
||
- name: Create folder | ||
run: | | ||
python updatedtime.py | ||
|
||
date_modified=$(cat DateModified.txt) | ||
if [ -z "$date_modified" ]; then | ||
date_published=$(cat DatePublished.txt) | ||
if [ -n "$date_published" ]; then | ||
date_modified=$date_published | ||
else | ||
date_modified=$(date -u +"%Y-%m-%dT%H-%M-%S") | ||
echo "Both DateModified.txt and DatePublished.txt are empty. Using the current time: $date_modified" | ||
fi | ||
fi | ||
folder_date=$(date -d "$date_modified" +"%Y-%m-%d") | ||
file_date=$(date -d "$date_modified" +"%Y-%m-%dT%H-%M") | ||
|
||
cp output_clean.pdf The_World_in_Brief.pdf | ||
mkdir -p WB/"$folder_date" | ||
# mv output_clean.pdf WB/"$folder_date"/Espresso_"$file_date".epub | ||
mv output_clean.pdf WB/"$folder_date"/Espresso_"$file_date".pdf | ||
|
||
- name: Commit and Push changes | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add WB/* The_World_in_Brief.pdf | ||
git commit -m "Initial commit" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Update Repo | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update-repo: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download zip file | ||
run: | | ||
# curl -L -o espresso-main.zip https://gitlab.com/Monkfishare/espresso/-/archive/main/espresso-main.zip | ||
curl -L -o espresso-main.zip https://codeload.github.com/sywidyc/espresso/zip/refs/heads/main?token=BHXGADFREGCYK5W6FHS3OA3G5BIJQ | ||
unzip espresso-main.zip -d espresso | ||
rm -rf WB | ||
mv espresso/espresso-main/* . | ||
- name: Commit and Push changes | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add WB/* | ||
git commit -m "Initial commit" | ||
git push |
Oops, something went wrong.