Skip to content

Commit

Permalink
Update static.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Jan 26, 2024
1 parent dfb9181 commit 3b3bf90
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/static.yml
@@ -1,8 +1,6 @@
name: Deploy static content to Pages

on:
schedule:
- cron: '37 3 * * *' # Run every 24 hours
push:
branches: ["main"]
workflow_dispatch:
Expand All @@ -26,17 +24,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Mirror Freenet Website and Process HTML
# Step to mirror the Freenet website and remove script tags
- name: Mirror Freenet Website and Remove Script Tags
run: |
sudo apt-get install wget perl
wget -v --mirror --convert-links --adjust-extension --page-requisites --span-hosts --domains=freenet.org,private-user-images.githubusercontent.com --no-parent https://freenet.org -P freenet-website/
find freenet-website/ -name "*.html" -exec perl -i -0pe 's/<img[^>]*?githubusercontent\.com[^>]*>//g' {} \;
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent https://freenet.org -P freenet-website/
find freenet-website/ -name "*.html" -exec perl -i -0pe 's/<script.*?<\/script>//gs' {} \;
mv freenet-website/freenet.org/* freenet-website/
mv freenet-website/freenet.org/.* freenet-website/ || true
rmdir freenet-website/freenet.org
- name: Setup Pages
uses: actions/configure-pages@v4

Expand Down

0 comments on commit 3b3bf90

Please sign in to comment.