From 5f99e20ea3a786796c6c8a20aabfb38374c82b41 Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Fri, 22 Dec 2023 12:40:53 -0700 Subject: [PATCH] Copy static site and fix absolute links to *.php --- .github/workflows/deploy-preview-site.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-preview-site.yml b/.github/workflows/deploy-preview-site.yml index cdec7bc..db1b1d4 100644 --- a/.github/workflows/deploy-preview-site.yml +++ b/.github/workflows/deploy-preview-site.yml @@ -51,8 +51,10 @@ jobs: - name: Mirror website to get static pages run: httrack http://localhost:8080/index{,-en,-fr}.php -%k -%v2 -%F "" -A0 -I0 -s0 - - name: Fix up absolute PHP links + - name: Copy static site and fix absolute links to *.php run: | + cp -a localhost:8080 public + cd public sed -i 's#"/\([^"]\+\)\.php#"\1.html#g' *.html sed -i 's#"/\([^"]\+\)\.php#"../\1.html#g' */*.html @@ -63,7 +65,7 @@ jobs: - name: Upload artifact uses: actions/upload-pages-artifact@v2 with: - path: ./localhost_8080 + path: ./public # Deployment job deploy: